home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: ref6.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text, with CR line terminators
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[CR]
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [R*ch] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 53 69 6d 70 6c 65 20 |\chapter|{Simple |
|00000010| 73 74 61 74 65 6d 65 6e | 74 73 7d 0d 5c 69 6e 64 |statemen|ts}.\ind|
|00000020| 65 78 69 69 7b 73 69 6d | 70 6c 65 7d 7b 73 74 61 |exii{sim|ple}{sta|
|00000030| 74 65 6d 65 6e 74 7d 0d | 0d 53 69 6d 70 6c 65 20 |tement}.|.Simple |
|00000040| 73 74 61 74 65 6d 65 6e | 74 73 20 61 72 65 20 63 |statemen|ts are c|
|00000050| 6f 6d 70 72 69 73 65 64 | 20 77 69 74 68 69 6e 20 |omprised| within |
|00000060| 61 20 73 69 6e 67 6c 65 | 20 6c 6f 67 69 63 61 6c |a single| logical|
|00000070| 20 6c 69 6e 65 2e 0d 53 | 65 76 65 72 61 6c 20 73 | line..S|everal s|
|00000080| 69 6d 70 6c 65 20 73 74 | 61 74 65 6d 65 6e 74 73 |imple st|atements|
|00000090| 20 6d 61 79 20 6f 63 63 | 75 72 20 6f 6e 20 61 20 | may occ|ur on a |
|000000a0| 73 69 6e 67 6c 65 20 6c | 69 6e 65 20 73 65 70 61 |single l|ine sepa|
|000000b0| 72 61 74 65 64 0d 62 79 | 20 73 65 6d 69 63 6f 6c |rated.by| semicol|
|000000c0| 6f 6e 73 2e 20 20 54 68 | 65 20 73 79 6e 74 61 78 |ons. Th|e syntax|
|000000d0| 20 66 6f 72 20 73 69 6d | 70 6c 65 20 73 74 61 74 | for sim|ple stat|
|000000e0| 65 6d 65 6e 74 73 20 69 | 73 3a 0d 0d 5c 62 65 67 |ements i|s:..\beg|
|000000f0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 73 69 6d |in{verba|tim}.sim|
|00000100| 70 6c 65 5f 73 74 6d 74 | 3a 20 20 20 20 65 78 70 |ple_stmt|: exp|
|00000110| 72 65 73 73 69 6f 6e 5f | 73 74 6d 74 0d 20 20 20 |ression_|stmt. |
|00000120| 20 20 20 20 20 20 20 20 | 20 20 20 7c 20 61 73 73 | | | ass|
|00000130| 69 67 6e 6d 65 6e 74 5f | 73 74 6d 74 0d 20 20 20 |ignment_|stmt. |
|00000140| 20 20 20 20 20 20 20 20 | 20 20 20 7c 20 70 61 73 | | | pas|
|00000150| 73 5f 73 74 6d 74 0d 20 | 20 20 20 20 20 20 20 20 |s_stmt. | |
|00000160| 20 20 20 20 20 7c 20 64 | 65 6c 5f 73 74 6d 74 0d | | d|el_stmt.|
|00000170| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 7c 20 | | | |
|00000180| 70 72 69 6e 74 5f 73 74 | 6d 74 0d 20 20 20 20 20 |print_st|mt. |
|00000190| 20 20 20 20 20 20 20 20 | 20 7c 20 72 65 74 75 72 | | | retur|
|000001a0| 6e 5f 73 74 6d 74 0d 20 | 20 20 20 20 20 20 20 20 |n_stmt. | |
|000001b0| 20 20 20 20 20 7c 20 72 | 61 69 73 65 5f 73 74 6d | | r|aise_stm|
|000001c0| 74 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t. | |
|000001d0| 7c 20 62 72 65 61 6b 5f | 73 74 6d 74 0d 20 20 20 || break_|stmt. |
|000001e0| 20 20 20 20 20 20 20 20 | 20 20 20 7c 20 63 6f 6e | | | con|
|000001f0| 74 69 6e 75 65 5f 73 74 | 6d 74 0d 20 20 20 20 20 |tinue_st|mt. |
|00000200| 20 20 20 20 20 20 20 20 | 20 7c 20 69 6d 70 6f 72 | | | impor|
|00000210| 74 5f 73 74 6d 74 0d 20 | 20 20 20 20 20 20 20 20 |t_stmt. | |
|00000220| 20 20 20 20 20 7c 20 67 | 6c 6f 62 61 6c 5f 73 74 | | g|lobal_st|
|00000230| 6d 74 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |mt. | |
|00000240| 20 7c 20 61 63 63 65 73 | 73 5f 73 74 6d 74 0d 20 | | acces|s_stmt. |
|00000250| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 7c 20 65 | | | e|
|00000260| 78 65 63 5f 73 74 6d 74 | 0d 5c 65 6e 64 7b 76 65 |xec_stmt|.\end{ve|
|00000270| 72 62 61 74 69 6d 7d 0d | 0d 5c 73 65 63 74 69 6f |rbatim}.|.\sectio|
|00000280| 6e 7b 45 78 70 72 65 73 | 73 69 6f 6e 20 73 74 61 |n{Expres|sion sta|
|00000290| 74 65 6d 65 6e 74 73 7d | 0d 5c 69 6e 64 65 78 69 |tements}|.\indexi|
|000002a0| 69 7b 65 78 70 72 65 73 | 73 69 6f 6e 7d 7b 73 74 |i{expres|sion}{st|
|000002b0| 61 74 65 6d 65 6e 74 7d | 0d 0d 45 78 70 72 65 73 |atement}|..Expres|
|000002c0| 73 69 6f 6e 20 73 74 61 | 74 65 6d 65 6e 74 73 20 |sion sta|tements |
|000002d0| 61 72 65 20 75 73 65 64 | 20 28 6d 6f 73 74 6c 79 |are used| (mostly|
|000002e0| 20 69 6e 74 65 72 61 63 | 74 69 76 65 6c 79 29 20 | interac|tively) |
|000002f0| 74 6f 20 63 6f 6d 70 75 | 74 65 20 61 6e 64 0d 77 |to compu|te and.w|
|00000300| 72 69 74 65 20 61 20 76 | 61 6c 75 65 2c 20 6f 72 |rite a v|alue, or|
|00000310| 20 28 75 73 75 61 6c 6c | 79 29 20 74 6f 20 63 61 | (usuall|y) to ca|
|00000320| 6c 6c 20 61 20 70 72 6f | 63 65 64 75 72 65 20 28 |ll a pro|cedure (|
|00000330| 61 20 66 75 6e 63 74 69 | 6f 6e 20 74 68 61 74 0d |a functi|on that.|
|00000340| 72 65 74 75 72 6e 73 20 | 6e 6f 20 6d 65 61 6e 69 |returns |no meani|
|00000350| 6e 67 66 75 6c 20 72 65 | 73 75 6c 74 3b 20 69 6e |ngful re|sult; in|
|00000360| 20 50 79 74 68 6f 6e 2c | 20 70 72 6f 63 65 64 75 | Python,| procedu|
|00000370| 72 65 73 20 72 65 74 75 | 72 6e 20 74 68 65 20 76 |res retu|rn the v|
|00000380| 61 6c 75 65 0d 5c 76 65 | 72 62 40 4e 6f 6e 65 40 |alue.\ve|rb@None@|
|00000390| 29 3a 0d 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |):..\beg|in{verba|
|000003a0| 74 69 6d 7d 0d 65 78 70 | 72 65 73 73 69 6f 6e 5f |tim}.exp|ression_|
|000003b0| 73 74 6d 74 3a 20 65 78 | 70 72 65 73 73 69 6f 6e |stmt: ex|pression|
|000003c0| 5f 6c 69 73 74 0d 5c 65 | 6e 64 7b 76 65 72 62 61 |_list.\e|nd{verba|
|000003d0| 74 69 6d 7d 0d 0d 41 6e | 20 65 78 70 72 65 73 73 |tim}..An| express|
|000003e0| 69 6f 6e 20 73 74 61 74 | 65 6d 65 6e 74 20 65 76 |ion stat|ement ev|
|000003f0| 61 6c 75 61 74 65 73 20 | 74 68 65 20 65 78 70 72 |aluates |the expr|
|00000400| 65 73 73 69 6f 6e 20 6c | 69 73 74 20 28 77 68 69 |ession l|ist (whi|
|00000410| 63 68 20 6d 61 79 20 62 | 65 20 61 0d 73 69 6e 67 |ch may b|e a.sing|
|00000420| 6c 65 20 65 78 70 72 65 | 73 73 69 6f 6e 29 2e 20 |le expre|ssion). |
|00000430| 20 49 66 20 74 68 65 20 | 76 61 6c 75 65 20 69 73 | If the |value is|
|00000440| 20 6e 6f 74 20 5c 76 65 | 72 62 40 4e 6f 6e 65 40 | not \ve|rb@None@|
|00000450| 2c 20 69 74 20 69 73 20 | 63 6f 6e 76 65 72 74 65 |, it is |converte|
|00000460| 64 0d 74 6f 20 61 20 73 | 74 72 69 6e 67 20 75 73 |d.to a s|tring us|
|00000470| 69 6e 67 20 74 68 65 20 | 72 75 6c 65 73 20 66 6f |ing the |rules fo|
|00000480| 72 20 73 74 72 69 6e 67 | 20 63 6f 6e 76 65 72 73 |r string| convers|
|00000490| 69 6f 6e 73 20 28 65 78 | 70 72 65 73 73 69 6f 6e |ions (ex|pression|
|000004a0| 73 20 69 6e 0d 72 65 76 | 65 72 73 65 20 71 75 6f |s in.rev|erse quo|
|000004b0| 74 65 73 29 2c 20 61 6e | 64 20 74 68 65 20 72 65 |tes), an|d the re|
|000004c0| 73 75 6c 74 69 6e 67 20 | 73 74 72 69 6e 67 20 69 |sulting |string i|
|000004d0| 73 20 77 72 69 74 74 65 | 6e 20 74 6f 20 73 74 61 |s writte|n to sta|
|000004e0| 6e 64 61 72 64 0d 6f 75 | 74 70 75 74 20 28 73 65 |ndard.ou|tput (se|
|000004f0| 65 20 73 65 63 74 69 6f | 6e 20 5c 72 65 66 7b 70 |e sectio|n \ref{p|
|00000500| 72 69 6e 74 7d 29 20 6f | 6e 20 61 20 6c 69 6e 65 |rint}) o|n a line|
|00000510| 20 62 79 20 69 74 73 65 | 6c 66 2e 0d 5c 69 6e 64 | by itse|lf..\ind|
|00000520| 65 78 69 69 7b 65 78 70 | 72 65 73 73 69 6f 6e 7d |exii{exp|ression}|
|00000530| 7b 6c 69 73 74 7d 0d 5c | 74 74 69 6e 64 65 78 7b |{list}.\|ttindex{|
|00000540| 4e 6f 6e 65 7d 0d 5c 69 | 6e 64 65 78 69 69 7b 73 |None}.\i|ndexii{s|
|00000550| 74 72 69 6e 67 7d 7b 63 | 6f 6e 76 65 72 73 69 6f |tring}{c|onversio|
|00000560| 6e 7d 0d 5c 69 6e 64 65 | 78 7b 6f 75 74 70 75 74 |n}.\inde|x{output|
|00000570| 7d 0d 5c 69 6e 64 65 78 | 69 69 7b 73 74 61 6e 64 |}.\index|ii{stand|
|00000580| 61 72 64 7d 7b 6f 75 74 | 70 75 74 7d 0d 5c 69 6e |ard}{out|put}.\in|
|00000590| 64 65 78 69 69 7b 77 72 | 69 74 69 6e 67 7d 7b 76 |dexii{wr|iting}{v|
|000005a0| 61 6c 75 65 73 7d 0d 0d | 28 54 68 65 20 65 78 63 |alues}..|(The exc|
|000005b0| 65 70 74 69 6f 6e 20 66 | 6f 72 20 5c 76 65 72 62 |eption f|or \verb|
|000005c0| 40 4e 6f 6e 65 40 20 69 | 73 20 6d 61 64 65 20 73 |@None@ i|s made s|
|000005d0| 6f 20 74 68 61 74 20 70 | 72 6f 63 65 64 75 72 65 |o that p|rocedure|
|000005e0| 20 63 61 6c 6c 73 2c 20 | 77 68 69 63 68 0d 61 72 | calls, |which.ar|
|000005f0| 65 20 73 79 6e 74 61 63 | 74 69 63 61 6c 6c 79 20 |e syntac|tically |
|00000600| 65 71 75 69 76 61 6c 65 | 6e 74 20 74 6f 20 65 78 |equivale|nt to ex|
|00000610| 70 72 65 73 73 69 6f 6e | 73 2c 20 64 6f 20 6e 6f |pression|s, do no|
|00000620| 74 20 63 61 75 73 65 20 | 61 6e 79 20 6f 75 74 70 |t cause |any outp|
|00000630| 75 74 2e 0d 41 20 74 75 | 70 6c 65 20 77 69 74 68 |ut..A tu|ple with|
|00000640| 20 6f 6e 6c 79 20 5c 76 | 65 72 62 40 4e 6f 6e 65 | only \v|erb@None|
|00000650| 40 20 69 74 65 6d 73 20 | 69 73 20 77 72 69 74 74 |@ items |is writt|
|00000660| 65 6e 20 6e 6f 72 6d 61 | 6c 6c 79 2e 29 0d 5c 69 |en norma|lly.).\i|
|00000670| 6e 64 65 78 69 69 7b 70 | 72 6f 63 65 64 75 72 65 |ndexii{p|rocedure|
|00000680| 7d 7b 63 61 6c 6c 7d 0d | 0d 5c 73 65 63 74 69 6f |}{call}.|.\sectio|
|00000690| 6e 7b 41 73 73 69 67 6e | 6d 65 6e 74 20 73 74 61 |n{Assign|ment sta|
|000006a0| 74 65 6d 65 6e 74 73 7d | 0d 5c 69 6e 64 65 78 69 |tements}|.\indexi|
|000006b0| 69 7b 61 73 73 69 67 6e | 6d 65 6e 74 7d 7b 73 74 |i{assign|ment}{st|
|000006c0| 61 74 65 6d 65 6e 74 7d | 0d 0d 41 73 73 69 67 6e |atement}|..Assign|
|000006d0| 6d 65 6e 74 20 73 74 61 | 74 65 6d 65 6e 74 73 20 |ment sta|tements |
|000006e0| 61 72 65 20 75 73 65 64 | 20 74 6f 20 28 72 65 29 |are used| to (re)|
|000006f0| 62 69 6e 64 20 6e 61 6d | 65 73 20 74 6f 20 76 61 |bind nam|es to va|
|00000700| 6c 75 65 73 20 61 6e 64 | 20 74 6f 0d 6d 6f 64 69 |lues and| to.modi|
|00000710| 66 79 20 61 74 74 72 69 | 62 75 74 65 73 20 6f 72 |fy attri|butes or|
|00000720| 20 69 74 65 6d 73 20 6f | 66 20 6d 75 74 61 62 6c | items o|f mutabl|
|00000730| 65 20 6f 62 6a 65 63 74 | 73 3a 0d 5c 69 6e 64 65 |e object|s:.\inde|
|00000740| 78 69 69 7b 62 69 6e 64 | 69 6e 67 7d 7b 6e 61 6d |xii{bind|ing}{nam|
|00000750| 65 7d 0d 5c 69 6e 64 65 | 78 69 69 7b 72 65 62 69 |e}.\inde|xii{rebi|
|00000760| 6e 64 69 6e 67 7d 7b 6e | 61 6d 65 7d 0d 5c 6f 62 |nding}{n|ame}.\ob|
|00000770| 69 6e 64 65 78 7b 6d 75 | 74 61 62 6c 65 7d 0d 5c |index{mu|table}.\|
|00000780| 69 6e 64 65 78 69 69 7b | 61 74 74 72 69 62 75 74 |indexii{|attribut|
|00000790| 65 7d 7b 61 73 73 69 67 | 6e 6d 65 6e 74 7d 0d 0d |e}{assig|nment}..|
|000007a0| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|000007b0| 0d 61 73 73 69 67 6e 6d | 65 6e 74 5f 73 74 6d 74 |.assignm|ent_stmt|
|000007c0| 3a 20 28 74 61 72 67 65 | 74 5f 6c 69 73 74 20 22 |: (targe|t_list "|
|000007d0| 3d 22 29 2b 20 65 78 70 | 72 65 73 73 69 6f 6e 5f |=")+ exp|ression_|
|000007e0| 6c 69 73 74 0d 74 61 72 | 67 65 74 5f 6c 69 73 74 |list.tar|get_list|
|000007f0| 3a 20 20 20 20 20 74 61 | 72 67 65 74 20 28 22 2c |: ta|rget (",|
|00000800| 22 20 74 61 72 67 65 74 | 29 2a 20 5b 22 2c 22 5d |" target|)* [","]|
|00000810| 0d 74 61 72 67 65 74 3a | 20 20 20 20 20 20 20 20 |.target:| |
|00000820| 20 20 69 64 65 6e 74 69 | 66 69 65 72 20 7c 20 22 | identi|fier | "|
|00000830| 28 22 20 74 61 72 67 65 | 74 5f 6c 69 73 74 20 22 |(" targe|t_list "|
|00000840| 29 22 20 7c 20 22 5b 22 | 20 74 61 72 67 65 74 5f |)" | "["| target_|
|00000850| 6c 69 73 74 20 22 5d 22 | 0d 20 20 20 20 20 20 20 |list "]"|. |
|00000860| 20 20 20 20 20 20 20 20 | 7c 20 61 74 74 72 69 62 | || attrib|
|00000870| 75 74 65 72 65 66 20 7c | 20 73 75 62 73 63 72 69 |uteref || subscri|
|00000880| 70 74 69 6f 6e 20 7c 20 | 73 6c 69 63 69 6e 67 0d |ption | |slicing.|
|00000890| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 0d 0d |\end{ver|batim}..|
|000008a0| 28 53 65 65 20 73 65 63 | 74 69 6f 6e 20 5c 72 65 |(See sec|tion \re|
|000008b0| 66 7b 70 72 69 6d 61 72 | 69 65 73 7d 20 66 6f 72 |f{primar|ies} for|
|000008c0| 20 74 68 65 20 73 79 6e | 74 61 78 20 64 65 66 69 | the syn|tax defi|
|000008d0| 6e 69 74 69 6f 6e 73 20 | 66 6f 72 20 74 68 65 20 |nitions |for the |
|000008e0| 6c 61 73 74 0d 74 68 72 | 65 65 20 73 79 6d 62 6f |last.thr|ee symbo|
|000008f0| 6c 73 2e 29 0d 0d 41 6e | 20 61 73 73 69 67 6e 6d |ls.)..An| assignm|
|00000900| 65 6e 74 20 73 74 61 74 | 65 6d 65 6e 74 20 65 76 |ent stat|ement ev|
|00000910| 61 6c 75 61 74 65 73 20 | 74 68 65 20 65 78 70 72 |aluates |the expr|
|00000920| 65 73 73 69 6f 6e 20 6c | 69 73 74 20 28 72 65 6d |ession l|ist (rem|
|00000930| 65 6d 62 65 72 20 74 68 | 61 74 0d 74 68 69 73 20 |ember th|at.this |
|00000940| 63 61 6e 20 62 65 20 61 | 20 73 69 6e 67 6c 65 20 |can be a| single |
|00000950| 65 78 70 72 65 73 73 69 | 6f 6e 20 6f 72 20 61 20 |expressi|on or a |
|00000960| 63 6f 6d 6d 61 2d 73 65 | 70 61 72 61 74 65 64 20 |comma-se|parated |
|00000970| 6c 69 73 74 2c 20 74 68 | 65 20 6c 61 74 74 65 72 |list, th|e latter|
|00000980| 0d 79 69 65 6c 64 69 6e | 67 20 61 20 74 75 70 6c |.yieldin|g a tupl|
|00000990| 65 29 20 61 6e 64 20 61 | 73 73 69 67 6e 73 20 74 |e) and a|ssigns t|
|000009a0| 68 65 20 73 69 6e 67 6c | 65 20 72 65 73 75 6c 74 |he singl|e result|
|000009b0| 69 6e 67 20 6f 62 6a 65 | 63 74 20 74 6f 20 65 61 |ing obje|ct to ea|
|000009c0| 63 68 20 6f 66 0d 74 68 | 65 20 74 61 72 67 65 74 |ch of.th|e target|
|000009d0| 20 6c 69 73 74 73 2c 20 | 66 72 6f 6d 20 6c 65 66 | lists, |from lef|
|000009e0| 74 20 74 6f 20 72 69 67 | 68 74 2e 0d 5c 69 6e 64 |t to rig|ht..\ind|
|000009f0| 65 78 69 69 7b 65 78 70 | 72 65 73 73 69 6f 6e 7d |exii{exp|ression}|
|00000a00| 7b 6c 69 73 74 7d 0d 0d | 41 73 73 69 67 6e 6d 65 |{list}..|Assignme|
|00000a10| 6e 74 20 69 73 20 64 65 | 66 69 6e 65 64 20 72 65 |nt is de|fined re|
|00000a20| 63 75 72 73 69 76 65 6c | 79 20 64 65 70 65 6e 64 |cursivel|y depend|
|00000a30| 69 6e 67 20 6f 6e 20 74 | 68 65 20 66 6f 72 6d 20 |ing on t|he form |
|00000a40| 6f 66 20 74 68 65 20 74 | 61 72 67 65 74 0d 28 6c |of the t|arget.(l|
|00000a50| 69 73 74 29 2e 20 20 57 | 68 65 6e 20 61 20 74 61 |ist). W|hen a ta|
|00000a60| 72 67 65 74 20 69 73 20 | 70 61 72 74 20 6f 66 20 |rget is |part of |
|00000a70| 61 20 6d 75 74 61 62 6c | 65 20 6f 62 6a 65 63 74 |a mutabl|e object|
|00000a80| 20 28 61 6e 20 61 74 74 | 72 69 62 75 74 65 0d 72 | (an att|ribute.r|
|00000a90| 65 66 65 72 65 6e 63 65 | 2c 20 73 75 62 73 63 72 |eference|, subscr|
|00000aa0| 69 70 74 69 6f 6e 20 6f | 72 20 73 6c 69 63 69 6e |iption o|r slicin|
|00000ab0| 67 29 2c 20 74 68 65 20 | 6d 75 74 61 62 6c 65 20 |g), the |mutable |
|00000ac0| 6f 62 6a 65 63 74 20 6d | 75 73 74 0d 75 6c 74 69 |object m|ust.ulti|
|00000ad0| 6d 61 74 65 6c 79 20 70 | 65 72 66 6f 72 6d 20 74 |mately p|erform t|
|00000ae0| 68 65 20 61 73 73 69 67 | 6e 6d 65 6e 74 20 61 6e |he assig|nment an|
|00000af0| 64 20 64 65 63 69 64 65 | 20 61 62 6f 75 74 20 69 |d decide| about i|
|00000b00| 74 73 20 76 61 6c 69 64 | 69 74 79 2c 20 61 6e 64 |ts valid|ity, and|
|00000b10| 0d 6d 61 79 20 72 61 69 | 73 65 20 61 6e 20 65 78 |.may rai|se an ex|
|00000b20| 63 65 70 74 69 6f 6e 20 | 69 66 20 74 68 65 20 61 |ception |if the a|
|00000b30| 73 73 69 67 6e 6d 65 6e | 74 20 69 73 20 75 6e 61 |ssignmen|t is una|
|00000b40| 63 63 65 70 74 61 62 6c | 65 2e 20 20 54 68 65 20 |cceptabl|e. The |
|00000b50| 72 75 6c 65 73 0d 6f 62 | 73 65 72 76 65 64 20 62 |rules.ob|served b|
|00000b60| 79 20 76 61 72 69 6f 75 | 73 20 74 79 70 65 73 20 |y variou|s types |
|00000b70| 61 6e 64 20 74 68 65 20 | 65 78 63 65 70 74 69 6f |and the |exceptio|
|00000b80| 6e 73 20 72 61 69 73 65 | 64 20 61 72 65 20 67 69 |ns raise|d are gi|
|00000b90| 76 65 6e 20 77 69 74 68 | 20 74 68 65 0d 64 65 66 |ven with| the.def|
|00000ba0| 69 6e 69 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 6f |inition |of the o|
|00000bb0| 62 6a 65 63 74 20 74 79 | 70 65 73 20 28 73 65 65 |bject ty|pes (see|
|00000bc0| 20 73 65 63 74 69 6f 6e | 20 5c 72 65 66 7b 74 79 | section| \ref{ty|
|00000bd0| 70 65 73 7d 29 2e 0d 5c | 69 6e 64 65 78 7b 74 61 |pes})..\|index{ta|
|00000be0| 72 67 65 74 7d 0d 5c 69 | 6e 64 65 78 69 69 7b 74 |rget}.\i|ndexii{t|
|00000bf0| 61 72 67 65 74 7d 7b 6c | 69 73 74 7d 0d 0d 41 73 |arget}{l|ist}..As|
|00000c00| 73 69 67 6e 6d 65 6e 74 | 20 6f 66 20 61 6e 20 6f |signment| of an o|
|00000c10| 62 6a 65 63 74 20 74 6f | 20 61 20 74 61 72 67 65 |bject to| a targe|
|00000c20| 74 20 6c 69 73 74 20 69 | 73 20 72 65 63 75 72 73 |t list i|s recurs|
|00000c30| 69 76 65 6c 79 20 64 65 | 66 69 6e 65 64 20 61 73 |ively de|fined as|
|00000c40| 0d 66 6f 6c 6c 6f 77 73 | 2e 0d 5c 69 6e 64 65 78 |.follows|..\index|
|00000c50| 69 69 69 7b 74 61 72 67 | 65 74 7d 7b 6c 69 73 74 |iii{targ|et}{list|
|00000c60| 7d 7b 61 73 73 69 67 6e | 6d 65 6e 74 7d 0d 0d 5c |}{assign|ment}..\|
|00000c70| 62 65 67 69 6e 7b 69 74 | 65 6d 69 7a 65 7d 0d 5c |begin{it|emize}.\|
|00000c80| 69 74 65 6d 0d 49 66 20 | 74 68 65 20 74 61 72 67 |item.If |the targ|
|00000c90| 65 74 20 6c 69 73 74 20 | 69 73 20 61 20 73 69 6e |et list |is a sin|
|00000ca0| 67 6c 65 20 74 61 72 67 | 65 74 3a 20 74 68 65 20 |gle targ|et: the |
|00000cb0| 6f 62 6a 65 63 74 20 69 | 73 20 61 73 73 69 67 6e |object i|s assign|
|00000cc0| 65 64 20 74 6f 20 74 68 | 61 74 0d 74 61 72 67 65 |ed to th|at.targe|
|00000cd0| 74 2e 0d 0d 5c 69 74 65 | 6d 0d 49 66 20 74 68 65 |t...\ite|m.If the|
|00000ce0| 20 74 61 72 67 65 74 20 | 6c 69 73 74 20 69 73 20 | target |list is |
|00000cf0| 61 20 63 6f 6d 6d 61 2d | 73 65 70 61 72 61 74 65 |a comma-|separate|
|00000d00| 64 20 6c 69 73 74 20 6f | 66 20 74 61 72 67 65 74 |d list o|f target|
|00000d10| 73 3a 20 74 68 65 20 6f | 62 6a 65 63 74 0d 6d 75 |s: the o|bject.mu|
|00000d20| 73 74 20 62 65 20 61 20 | 74 75 70 6c 65 20 77 69 |st be a |tuple wi|
|00000d30| 74 68 20 74 68 65 20 73 | 61 6d 65 20 6e 75 6d 62 |th the s|ame numb|
|00000d40| 65 72 20 6f 66 20 69 74 | 65 6d 73 20 61 73 20 74 |er of it|ems as t|
|00000d50| 68 65 20 6c 69 73 74 20 | 63 6f 6e 74 61 69 6e 73 |he list |contains|
|00000d60| 0d 74 61 72 67 65 74 73 | 2c 20 61 6e 64 20 74 68 |.targets|, and th|
|00000d70| 65 20 69 74 65 6d 73 20 | 61 72 65 20 61 73 73 69 |e items |are assi|
|00000d80| 67 6e 65 64 2c 20 66 72 | 6f 6d 20 6c 65 66 74 20 |gned, fr|om left |
|00000d90| 74 6f 20 72 69 67 68 74 | 2c 20 74 6f 20 74 68 65 |to right|, to the|
|00000da0| 0d 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 |.corresp|onding t|
|00000db0| 61 72 67 65 74 73 2e 0d | 0d 5c 65 6e 64 7b 69 74 |argets..|.\end{it|
|00000dc0| 65 6d 69 7a 65 7d 0d 0d | 41 73 73 69 67 6e 6d 65 |emize}..|Assignme|
|00000dd0| 6e 74 20 6f 66 20 61 6e | 20 6f 62 6a 65 63 74 20 |nt of an| object |
|00000de0| 74 6f 20 61 20 73 69 6e | 67 6c 65 20 74 61 72 67 |to a sin|gle targ|
|00000df0| 65 74 20 69 73 20 72 65 | 63 75 72 73 69 76 65 6c |et is re|cursivel|
|00000e00| 79 20 64 65 66 69 6e 65 | 64 20 61 73 0d 66 6f 6c |y define|d as.fol|
|00000e10| 6c 6f 77 73 2e 0d 0d 5c | 62 65 67 69 6e 7b 69 74 |lows...\|begin{it|
|00000e20| 65 6d 69 7a 65 7d 20 25 | 20 6e 65 73 74 65 64 0d |emize} %| nested.|
|00000e30| 0d 5c 69 74 65 6d 0d 49 | 66 20 74 68 65 20 74 61 |.\item.I|f the ta|
|00000e40| 72 67 65 74 20 69 73 20 | 61 6e 20 69 64 65 6e 74 |rget is |an ident|
|00000e50| 69 66 69 65 72 20 28 6e | 61 6d 65 29 3a 0d 0d 5c |ifier (n|ame):..\|
|00000e60| 62 65 67 69 6e 7b 69 74 | 65 6d 69 7a 65 7d 0d 0d |begin{it|emize}..|
|00000e70| 5c 69 74 65 6d 0d 49 66 | 20 74 68 65 20 6e 61 6d |\item.If| the nam|
|00000e80| 65 20 64 6f 65 73 20 6e | 6f 74 20 6f 63 63 75 72 |e does n|ot occur|
|00000e90| 20 69 6e 20 61 20 5c 76 | 65 72 62 40 67 6c 6f 62 | in a \v|erb@glob|
|00000ea0| 61 6c 40 20 73 74 61 74 | 65 6d 65 6e 74 20 69 6e |al@ stat|ement in|
|00000eb0| 20 74 68 65 20 63 75 72 | 72 65 6e 74 0d 63 6f 64 | the cur|rent.cod|
|00000ec0| 65 20 62 6c 6f 63 6b 3a | 20 74 68 65 20 6e 61 6d |e block:| the nam|
|00000ed0| 65 20 69 73 20 62 6f 75 | 6e 64 20 74 6f 20 74 68 |e is bou|nd to th|
|00000ee0| 65 20 6f 62 6a 65 63 74 | 20 69 6e 20 74 68 65 20 |e object| in the |
|00000ef0| 63 75 72 72 65 6e 74 20 | 6c 6f 63 61 6c 20 6e 61 |current |local na|
|00000f00| 6d 65 0d 73 70 61 63 65 | 2e 0d 5c 73 74 69 6e 64 |me.space|..\stind|
|00000f10| 65 78 7b 67 6c 6f 62 61 | 6c 7d 0d 0d 5c 69 74 65 |ex{globa|l}..\ite|
|00000f20| 6d 0d 4f 74 68 65 72 77 | 69 73 65 3a 20 74 68 65 |m.Otherw|ise: the|
|00000f30| 20 6e 61 6d 65 20 69 73 | 20 62 6f 75 6e 64 20 74 | name is| bound t|
|00000f40| 6f 20 74 68 65 20 6f 62 | 6a 65 63 74 20 69 6e 20 |o the ob|ject in |
|00000f50| 74 68 65 20 63 75 72 72 | 65 6e 74 20 67 6c 6f 62 |the curr|ent glob|
|00000f60| 61 6c 20 6e 61 6d 65 0d | 73 70 61 63 65 2e 0d 0d |al name.|space...|
|00000f70| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 20 25 20 |\end{ite|mize} % |
|00000f80| 6e 65 73 74 65 64 0d 0d | 54 68 65 20 6e 61 6d 65 |nested..|The name|
|00000f90| 20 69 73 20 72 65 62 6f | 75 6e 64 20 69 66 20 69 | is rebo|und if i|
|00000fa0| 74 20 77 61 73 20 61 6c | 72 65 61 64 79 20 62 6f |t was al|ready bo|
|00000fb0| 75 6e 64 2e 0d 0d 5c 69 | 74 65 6d 0d 49 66 20 74 |und...\i|tem.If t|
|00000fc0| 68 65 20 74 61 72 67 65 | 74 20 69 73 20 61 20 74 |he targe|t is a t|
|00000fd0| 61 72 67 65 74 20 6c 69 | 73 74 20 65 6e 63 6c 6f |arget li|st enclo|
|00000fe0| 73 65 64 20 69 6e 20 70 | 61 72 65 6e 74 68 65 73 |sed in p|arenthes|
|00000ff0| 65 73 3a 20 74 68 65 20 | 6f 62 6a 65 63 74 20 69 |es: the |object i|
|00001000| 73 0d 61 73 73 69 67 6e | 65 64 20 74 6f 20 74 68 |s.assign|ed to th|
|00001010| 61 74 20 74 61 72 67 65 | 74 20 6c 69 73 74 20 61 |at targe|t list a|
|00001020| 73 20 64 65 73 63 72 69 | 62 65 64 20 61 62 6f 76 |s descri|bed abov|
|00001030| 65 2e 0d 0d 5c 69 74 65 | 6d 0d 49 66 20 74 68 65 |e...\ite|m.If the|
|00001040| 20 74 61 72 67 65 74 20 | 69 73 20 61 20 74 61 72 | target |is a tar|
|00001050| 67 65 74 20 6c 69 73 74 | 20 65 6e 63 6c 6f 73 65 |get list| enclose|
|00001060| 64 20 69 6e 20 73 71 75 | 61 72 65 20 62 72 61 63 |d in squ|are brac|
|00001070| 6b 65 74 73 3a 20 74 68 | 65 20 6f 62 6a 65 63 74 |kets: th|e object|
|00001080| 0d 6d 75 73 74 20 62 65 | 20 61 20 6c 69 73 74 20 |.must be| a list |
|00001090| 77 69 74 68 20 74 68 65 | 20 73 61 6d 65 20 6e 75 |with the| same nu|
|000010a0| 6d 62 65 72 20 6f 66 20 | 69 74 65 6d 73 20 61 73 |mber of |items as|
|000010b0| 20 74 68 65 20 74 61 72 | 67 65 74 20 6c 69 73 74 | the tar|get list|
|000010c0| 0d 63 6f 6e 74 61 69 6e | 73 20 74 61 72 67 65 74 |.contain|s target|
|000010d0| 73 2c 20 61 6e 64 20 69 | 74 73 20 69 74 65 6d 73 |s, and i|ts items|
|000010e0| 20 61 72 65 20 61 73 73 | 69 67 6e 65 64 2c 20 66 | are ass|igned, f|
|000010f0| 72 6f 6d 20 6c 65 66 74 | 20 74 6f 20 72 69 67 68 |rom left| to righ|
|00001100| 74 2c 20 74 6f 0d 74 68 | 65 20 63 6f 72 72 65 73 |t, to.th|e corres|
|00001110| 70 6f 6e 64 69 6e 67 20 | 74 61 72 67 65 74 73 2e |ponding |targets.|
|00001120| 0d 0d 5c 69 74 65 6d 0d | 49 66 20 74 68 65 20 74 |..\item.|If the t|
|00001130| 61 72 67 65 74 20 69 73 | 20 61 6e 20 61 74 74 72 |arget is| an attr|
|00001140| 69 62 75 74 65 20 72 65 | 66 65 72 65 6e 63 65 3a |ibute re|ference:|
|00001150| 20 54 68 65 20 70 72 69 | 6d 61 72 79 20 65 78 70 | The pri|mary exp|
|00001160| 72 65 73 73 69 6f 6e 20 | 69 6e 20 74 68 65 0d 72 |ression |in the.r|
|00001170| 65 66 65 72 65 6e 63 65 | 20 69 73 20 65 76 61 6c |eference| is eval|
|00001180| 75 61 74 65 64 2e 20 20 | 49 74 20 73 68 6f 75 6c |uated. |It shoul|
|00001190| 64 20 79 69 65 6c 64 20 | 61 6e 20 6f 62 6a 65 63 |d yield |an objec|
|000011a0| 74 20 77 69 74 68 20 61 | 73 73 69 67 6e 61 62 6c |t with a|ssignabl|
|000011b0| 65 0d 61 74 74 72 69 62 | 75 74 65 73 3b 20 69 66 |e.attrib|utes; if|
|000011c0| 20 74 68 69 73 20 69 73 | 20 6e 6f 74 20 74 68 65 | this is| not the|
|000011d0| 20 63 61 73 65 2c 20 5c | 76 65 72 62 40 54 79 70 | case, \|verb@Typ|
|000011e0| 65 45 72 72 6f 72 40 20 | 69 73 20 72 61 69 73 65 |eError@ |is raise|
|000011f0| 64 2e 20 20 54 68 61 74 | 0d 6f 62 6a 65 63 74 20 |d. That|.object |
|00001200| 69 73 20 74 68 65 6e 20 | 61 73 6b 65 64 20 74 6f |is then |asked to|
|00001210| 20 61 73 73 69 67 6e 20 | 74 68 65 20 61 73 73 69 | assign |the assi|
|00001220| 67 6e 65 64 20 6f 62 6a | 65 63 74 20 74 6f 20 74 |gned obj|ect to t|
|00001230| 68 65 20 67 69 76 65 6e | 0d 61 74 74 72 69 62 75 |he given|.attribu|
|00001240| 74 65 3b 20 69 66 20 69 | 74 20 63 61 6e 6e 6f 74 |te; if i|t cannot|
|00001250| 20 70 65 72 66 6f 72 6d | 20 74 68 65 20 61 73 73 | perform| the ass|
|00001260| 69 67 6e 6d 65 6e 74 2c | 20 69 74 20 72 61 69 73 |ignment,| it rais|
|00001270| 65 73 20 61 6e 20 65 78 | 63 65 70 74 69 6f 6e 0d |es an ex|ception.|
|00001280| 28 75 73 75 61 6c 6c 79 | 20 62 75 74 20 6e 6f 74 |(usually| but not|
|00001290| 20 6e 65 63 65 73 73 61 | 72 69 6c 79 20 5c 76 65 | necessa|rily \ve|
|000012a0| 72 62 40 41 74 74 72 69 | 62 75 74 65 45 72 72 6f |rb@Attri|buteErro|
|000012b0| 72 40 29 2e 0d 5c 69 6e | 64 65 78 69 69 7b 61 74 |r@)..\in|dexii{at|
|000012c0| 74 72 69 62 75 74 65 7d | 7b 61 73 73 69 67 6e 6d |tribute}|{assignm|
|000012d0| 65 6e 74 7d 0d 0d 5c 69 | 74 65 6d 0d 49 66 20 74 |ent}..\i|tem.If t|
|000012e0| 68 65 20 74 61 72 67 65 | 74 20 69 73 20 61 20 73 |he targe|t is a s|
|000012f0| 75 62 73 63 72 69 70 74 | 69 6f 6e 3a 20 54 68 65 |ubscript|ion: The|
|00001300| 20 70 72 69 6d 61 72 79 | 20 65 78 70 72 65 73 73 | primary| express|
|00001310| 69 6f 6e 20 69 6e 20 74 | 68 65 0d 72 65 66 65 72 |ion in t|he.refer|
|00001320| 65 6e 63 65 20 69 73 20 | 65 76 61 6c 75 61 74 65 |ence is |evaluate|
|00001330| 64 2e 20 20 49 74 20 73 | 68 6f 75 6c 64 20 79 69 |d. It s|hould yi|
|00001340| 65 6c 64 20 65 69 74 68 | 65 72 20 61 20 6d 75 74 |eld eith|er a mut|
|00001350| 61 62 6c 65 20 73 65 71 | 75 65 6e 63 65 0d 28 6c |able seq|uence.(l|
|00001360| 69 73 74 29 20 6f 62 6a | 65 63 74 20 6f 72 20 61 |ist) obj|ect or a|
|00001370| 20 6d 61 70 70 69 6e 67 | 20 28 64 69 63 74 69 6f | mapping| (dictio|
|00001380| 6e 61 72 79 29 20 6f 62 | 6a 65 63 74 2e 20 20 4e |nary) ob|ject. N|
|00001390| 65 78 74 2c 20 74 68 65 | 20 73 75 62 73 63 72 69 |ext, the| subscri|
|000013a0| 70 74 0d 65 78 70 72 65 | 73 73 69 6f 6e 20 69 73 |pt.expre|ssion is|
|000013b0| 20 65 76 61 6c 75 61 74 | 65 64 2e 0d 5c 69 6e 64 | evaluat|ed..\ind|
|000013c0| 65 78 69 69 7b 73 75 62 | 73 63 72 69 70 74 69 6f |exii{sub|scriptio|
|000013d0| 6e 7d 7b 61 73 73 69 67 | 6e 6d 65 6e 74 7d 0d 5c |n}{assig|nment}.\|
|000013e0| 6f 62 69 6e 64 65 78 7b | 6d 75 74 61 62 6c 65 7d |obindex{|mutable}|
|000013f0| 0d 0d 49 66 20 74 68 65 | 20 70 72 69 6d 61 72 79 |..If the| primary|
|00001400| 20 69 73 20 61 20 6d 75 | 74 61 62 6c 65 20 73 65 | is a mu|table se|
|00001410| 71 75 65 6e 63 65 20 6f | 62 6a 65 63 74 20 28 61 |quence o|bject (a|
|00001420| 20 6c 69 73 74 29 2c 20 | 74 68 65 20 73 75 62 73 | list), |the subs|
|00001430| 63 72 69 70 74 0d 6d 75 | 73 74 20 79 69 65 6c 64 |cript.mu|st yield|
|00001440| 20 61 20 70 6c 61 69 6e | 20 69 6e 74 65 67 65 72 | a plain| integer|
|00001450| 2e 20 20 49 66 20 69 74 | 20 69 73 20 6e 65 67 61 |. If it| is nega|
|00001460| 74 69 76 65 2c 20 74 68 | 65 20 73 65 71 75 65 6e |tive, th|e sequen|
|00001470| 63 65 27 73 20 6c 65 6e | 67 74 68 0d 69 73 20 61 |ce's len|gth.is a|
|00001480| 64 64 65 64 20 74 6f 20 | 69 74 2e 20 20 54 68 65 |dded to |it. The|
|00001490| 20 72 65 73 75 6c 74 69 | 6e 67 20 76 61 6c 75 65 | resulti|ng value|
|000014a0| 20 6d 75 73 74 20 62 65 | 20 61 20 6e 6f 6e 6e 65 | must be| a nonne|
|000014b0| 67 61 74 69 76 65 20 69 | 6e 74 65 67 65 72 0d 6c |gative i|nteger.l|
|000014c0| 65 73 73 20 74 68 61 6e | 20 74 68 65 20 73 65 71 |ess than| the seq|
|000014d0| 75 65 6e 63 65 27 73 20 | 6c 65 6e 67 74 68 2c 20 |uence's |length, |
|000014e0| 61 6e 64 20 74 68 65 20 | 73 65 71 75 65 6e 63 65 |and the |sequence|
|000014f0| 20 69 73 20 61 73 6b 65 | 64 20 74 6f 20 61 73 73 | is aske|d to ass|
|00001500| 69 67 6e 0d 74 68 65 20 | 61 73 73 69 67 6e 65 64 |ign.the |assigned|
|00001510| 20 6f 62 6a 65 63 74 20 | 74 6f 20 69 74 73 20 69 | object |to its i|
|00001520| 74 65 6d 20 77 69 74 68 | 20 74 68 61 74 20 69 6e |tem with| that in|
|00001530| 64 65 78 2e 20 20 49 66 | 20 74 68 65 20 69 6e 64 |dex. If| the ind|
|00001540| 65 78 20 69 73 20 6f 75 | 74 0d 6f 66 20 72 61 6e |ex is ou|t.of ran|
|00001550| 67 65 2c 20 5c 76 65 72 | 62 40 49 6e 64 65 78 45 |ge, \ver|b@IndexE|
|00001560| 72 72 6f 72 40 20 69 73 | 20 72 61 69 73 65 64 20 |rror@ is| raised |
|00001570| 28 61 73 73 69 67 6e 6d | 65 6e 74 20 74 6f 20 61 |(assignm|ent to a|
|00001580| 20 73 75 62 73 63 72 69 | 70 74 65 64 0d 73 65 71 | subscri|pted.seq|
|00001590| 75 65 6e 63 65 20 63 61 | 6e 6e 6f 74 20 61 64 64 |uence ca|nnot add|
|000015a0| 20 6e 65 77 20 69 74 65 | 6d 73 20 74 6f 20 61 20 | new ite|ms to a |
|000015b0| 6c 69 73 74 29 2e 0d 5c | 6f 62 69 6e 64 65 78 7b |list)..\|obindex{|
|000015c0| 73 65 71 75 65 6e 63 65 | 7d 0d 5c 6f 62 69 6e 64 |sequence|}.\obind|
|000015d0| 65 78 7b 6c 69 73 74 7d | 0d 0d 49 66 20 74 68 65 |ex{list}|..If the|
|000015e0| 20 70 72 69 6d 61 72 79 | 20 69 73 20 61 20 6d 61 | primary| is a ma|
|000015f0| 70 70 69 6e 67 20 28 64 | 69 63 74 69 6f 6e 61 72 |pping (d|ictionar|
|00001600| 79 29 20 6f 62 6a 65 63 | 74 2c 20 74 68 65 20 73 |y) objec|t, the s|
|00001610| 75 62 73 63 72 69 70 74 | 20 6d 75 73 74 0d 68 61 |ubscript| must.ha|
|00001620| 76 65 20 61 20 74 79 70 | 65 20 63 6f 6d 70 61 74 |ve a typ|e compat|
|00001630| 69 62 6c 65 20 77 69 74 | 68 20 74 68 65 20 6d 61 |ible wit|h the ma|
|00001640| 70 70 69 6e 67 27 73 20 | 6b 65 79 20 74 79 70 65 |pping's |key type|
|00001650| 2c 20 61 6e 64 20 74 68 | 65 20 6d 61 70 70 69 6e |, and th|e mappin|
|00001660| 67 20 69 73 0d 74 68 65 | 6e 20 61 73 6b 65 64 20 |g is.the|n asked |
|00001670| 74 6f 20 74 6f 20 63 72 | 65 61 74 65 20 61 20 6b |to to cr|eate a k|
|00001680| 65 79 2f 64 61 74 75 6d | 20 70 61 69 72 20 77 68 |ey/datum| pair wh|
|00001690| 69 63 68 20 6d 61 70 73 | 20 74 68 65 20 73 75 62 |ich maps| the sub|
|000016a0| 73 63 72 69 70 74 20 74 | 6f 0d 74 68 65 20 61 73 |script t|o.the as|
|000016b0| 73 69 67 6e 65 64 20 6f | 62 6a 65 63 74 2e 20 20 |signed o|bject. |
|000016c0| 54 68 69 73 20 63 61 6e | 20 65 69 74 68 65 72 20 |This can| either |
|000016d0| 72 65 70 6c 61 63 65 20 | 61 6e 20 65 78 69 73 74 |replace |an exist|
|000016e0| 69 6e 67 20 6b 65 79 2f | 76 61 6c 75 65 0d 70 61 |ing key/|value.pa|
|000016f0| 69 72 20 77 69 74 68 20 | 74 68 65 20 73 61 6d 65 |ir with |the same|
|00001700| 20 6b 65 79 20 76 61 6c | 75 65 2c 20 6f 72 20 69 | key val|ue, or i|
|00001710| 6e 73 65 72 74 20 61 20 | 6e 65 77 20 6b 65 79 2f |nsert a |new key/|
|00001720| 76 61 6c 75 65 20 70 61 | 69 72 20 28 69 66 20 6e |value pa|ir (if n|
|00001730| 6f 0d 6b 65 79 20 77 69 | 74 68 20 74 68 65 20 73 |o.key wi|th the s|
|00001740| 61 6d 65 20 76 61 6c 75 | 65 20 65 78 69 73 74 65 |ame valu|e existe|
|00001750| 64 29 2e 0d 5c 6f 62 69 | 6e 64 65 78 7b 6d 61 70 |d)..\obi|ndex{map|
|00001760| 70 69 6e 67 7d 0d 5c 6f | 62 69 6e 64 65 78 7b 64 |ping}.\o|bindex{d|
|00001770| 69 63 74 69 6f 6e 61 72 | 79 7d 0d 0d 5c 69 74 65 |ictionar|y}..\ite|
|00001780| 6d 0d 49 66 20 74 68 65 | 20 74 61 72 67 65 74 20 |m.If the| target |
|00001790| 69 73 20 61 20 73 6c 69 | 63 69 6e 67 3a 20 54 68 |is a sli|cing: Th|
|000017a0| 65 20 70 72 69 6d 61 72 | 79 20 65 78 70 72 65 73 |e primar|y expres|
|000017b0| 73 69 6f 6e 20 69 6e 20 | 74 68 65 20 72 65 66 65 |sion in |the refe|
|000017c0| 72 65 6e 63 65 20 69 73 | 0d 65 76 61 6c 75 61 74 |rence is|.evaluat|
|000017d0| 65 64 2e 20 20 49 74 20 | 73 68 6f 75 6c 64 20 79 |ed. It |should y|
|000017e0| 69 65 6c 64 20 61 20 6d | 75 74 61 62 6c 65 20 73 |ield a m|utable s|
|000017f0| 65 71 75 65 6e 63 65 20 | 6f 62 6a 65 63 74 20 28 |equence |object (|
|00001800| 65 2e 67 2e 20 61 20 6c | 69 73 74 29 2e 20 20 54 |e.g. a l|ist). T|
|00001810| 68 65 0d 61 73 73 69 67 | 6e 65 64 20 6f 62 6a 65 |he.assig|ned obje|
|00001820| 63 74 20 73 68 6f 75 6c | 64 20 62 65 20 61 20 73 |ct shoul|d be a s|
|00001830| 65 71 75 65 6e 63 65 20 | 6f 62 6a 65 63 74 20 6f |equence |object o|
|00001840| 66 20 74 68 65 20 73 61 | 6d 65 20 74 79 70 65 2e |f the sa|me type.|
|00001850| 20 20 4e 65 78 74 2c 0d | 74 68 65 20 6c 6f 77 65 | Next,.|the lowe|
|00001860| 72 20 61 6e 64 20 75 70 | 70 65 72 20 62 6f 75 6e |r and up|per boun|
|00001870| 64 20 65 78 70 72 65 73 | 73 69 6f 6e 73 20 61 72 |d expres|sions ar|
|00001880| 65 20 65 76 61 6c 75 61 | 74 65 64 2c 20 69 6e 73 |e evalua|ted, ins|
|00001890| 6f 66 61 72 20 74 68 65 | 79 20 61 72 65 0d 70 72 |ofar the|y are.pr|
|000018a0| 65 73 65 6e 74 3b 20 64 | 65 66 61 75 6c 74 73 20 |esent; d|efaults |
|000018b0| 61 72 65 20 7a 65 72 6f | 20 61 6e 64 20 74 68 65 |are zero| and the|
|000018c0| 20 73 65 71 75 65 6e 63 | 65 27 73 20 6c 65 6e 67 | sequenc|e's leng|
|000018d0| 74 68 2e 20 20 54 68 65 | 20 62 6f 75 6e 64 73 0d |th. The| bounds.|
|000018e0| 73 68 6f 75 6c 64 20 65 | 76 61 6c 75 61 74 65 20 |should e|valuate |
|000018f0| 74 6f 20 28 73 6d 61 6c | 6c 29 20 69 6e 74 65 67 |to (smal|l) integ|
|00001900| 65 72 73 2e 20 20 49 66 | 20 65 69 74 68 65 72 20 |ers. If| either |
|00001910| 62 6f 75 6e 64 20 69 73 | 20 6e 65 67 61 74 69 76 |bound is| negativ|
|00001920| 65 2c 20 74 68 65 0d 73 | 65 71 75 65 6e 63 65 27 |e, the.s|equence'|
|00001930| 73 20 6c 65 6e 67 74 68 | 20 69 73 20 61 64 64 65 |s length| is adde|
|00001940| 64 20 74 6f 20 69 74 2e | 20 20 54 68 65 20 72 65 |d to it.| The re|
|00001950| 73 75 6c 74 69 6e 67 20 | 62 6f 75 6e 64 73 20 61 |sulting |bounds a|
|00001960| 72 65 20 63 6c 69 70 70 | 65 64 20 74 6f 0d 6c 69 |re clipp|ed to.li|
|00001970| 65 20 62 65 74 77 65 65 | 6e 20 7a 65 72 6f 20 61 |e betwee|n zero a|
|00001980| 6e 64 20 74 68 65 20 73 | 65 71 75 65 6e 63 65 27 |nd the s|equence'|
|00001990| 73 20 6c 65 6e 67 74 68 | 2c 20 69 6e 63 6c 75 73 |s length|, inclus|
|000019a0| 69 76 65 2e 20 20 46 69 | 6e 61 6c 6c 79 2c 20 74 |ive. Fi|nally, t|
|000019b0| 68 65 0d 73 65 71 75 65 | 6e 63 65 20 6f 62 6a 65 |he.seque|nce obje|
|000019c0| 63 74 20 69 73 20 61 73 | 6b 65 64 20 74 6f 20 72 |ct is as|ked to r|
|000019d0| 65 70 6c 61 63 65 20 74 | 68 65 20 73 6c 69 63 65 |eplace t|he slice|
|000019e0| 20 77 69 74 68 20 74 68 | 65 20 69 74 65 6d 73 20 | with th|e items |
|000019f0| 6f 66 20 74 68 65 0d 61 | 73 73 69 67 6e 65 64 20 |of the.a|ssigned |
|00001a00| 73 65 71 75 65 6e 63 65 | 2e 20 20 54 68 65 20 6c |sequence|. The l|
|00001a10| 65 6e 67 74 68 20 6f 66 | 20 74 68 65 20 73 6c 69 |ength of| the sli|
|00001a20| 63 65 20 6d 61 79 20 62 | 65 20 64 69 66 66 65 72 |ce may b|e differ|
|00001a30| 65 6e 74 20 66 72 6f 6d | 20 74 68 65 0d 6c 65 6e |ent from| the.len|
|00001a40| 67 74 68 20 6f 66 20 74 | 68 65 20 61 73 73 69 67 |gth of t|he assig|
|00001a50| 6e 65 64 20 73 65 71 75 | 65 6e 63 65 2c 20 74 68 |ned sequ|ence, th|
|00001a60| 75 73 20 63 68 61 6e 67 | 69 6e 67 20 74 68 65 20 |us chang|ing the |
|00001a70| 6c 65 6e 67 74 68 20 6f | 66 20 74 68 65 0d 74 61 |length o|f the.ta|
|00001a80| 72 67 65 74 20 73 65 71 | 75 65 6e 63 65 2c 20 69 |rget seq|uence, i|
|00001a90| 66 20 74 68 65 20 6f 62 | 6a 65 63 74 20 61 6c 6c |f the ob|ject all|
|00001aa0| 6f 77 73 20 69 74 2e 0d | 5c 69 6e 64 65 78 69 69 |ows it..|\indexii|
|00001ab0| 7b 73 6c 69 63 69 6e 67 | 7d 7b 61 73 73 69 67 6e |{slicing|}{assign|
|00001ac0| 6d 65 6e 74 7d 0d 0d 5c | 65 6e 64 7b 69 74 65 6d |ment}..\|end{item|
|00001ad0| 69 7a 65 7d 0d 09 0d 28 | 49 6e 20 74 68 65 20 63 |ize}...(|In the c|
|00001ae0| 75 72 72 65 6e 74 20 69 | 6d 70 6c 65 6d 65 6e 74 |urrent i|mplement|
|00001af0| 61 74 69 6f 6e 2c 20 74 | 68 65 20 73 79 6e 74 61 |ation, t|he synta|
|00001b00| 78 20 66 6f 72 20 74 61 | 72 67 65 74 73 20 69 73 |x for ta|rgets is|
|00001b10| 20 74 61 6b 65 6e 0d 74 | 6f 20 62 65 20 74 68 65 | taken.t|o be the|
|00001b20| 20 73 61 6d 65 20 61 73 | 20 66 6f 72 20 65 78 70 | same as| for exp|
|00001b30| 72 65 73 73 69 6f 6e 73 | 2c 20 61 6e 64 20 69 6e |ressions|, and in|
|00001b40| 76 61 6c 69 64 20 73 79 | 6e 74 61 78 20 69 73 20 |valid sy|ntax is |
|00001b50| 72 65 6a 65 63 74 65 64 | 0d 64 75 72 69 6e 67 20 |rejected|.during |
|00001b60| 74 68 65 20 63 6f 64 65 | 20 67 65 6e 65 72 61 74 |the code| generat|
|00001b70| 69 6f 6e 20 70 68 61 73 | 65 2c 20 63 61 75 73 69 |ion phas|e, causi|
|00001b80| 6e 67 20 6c 65 73 73 20 | 64 65 74 61 69 6c 65 64 |ng less |detailed|
|00001b90| 20 65 72 72 6f 72 0d 6d | 65 73 73 61 67 65 73 2e | error.m|essages.|
|00001ba0| 29 0d 0d 57 41 52 4e 49 | 4e 47 3a 20 41 6c 74 68 |)..WARNI|NG: Alth|
|00001bb0| 6f 75 67 68 20 74 68 65 | 20 64 65 66 69 6e 69 74 |ough the| definit|
|00001bc0| 69 6f 6e 20 6f 66 20 61 | 73 73 69 67 6e 6d 65 6e |ion of a|ssignmen|
|00001bd0| 74 20 69 6d 70 6c 69 65 | 73 20 74 68 61 74 20 6f |t implie|s that o|
|00001be0| 76 65 72 6c 61 70 73 0d | 62 65 74 77 65 65 6e 20 |verlaps.|between |
|00001bf0| 74 68 65 20 6c 65 66 74 | 2d 68 61 6e 64 20 73 69 |the left|-hand si|
|00001c00| 64 65 20 61 6e 64 20 74 | 68 65 20 72 69 67 68 74 |de and t|he right|
|00001c10| 2d 68 61 6e 64 20 73 69 | 64 65 20 61 72 65 20 60 |-hand si|de are `|
|00001c20| 73 61 66 65 27 20 28 65 | 2e 67 2e 0d 5c 76 65 72 |safe' (e|.g..\ver|
|00001c30| 62 40 61 2c 20 62 20 3d | 20 62 2c 20 61 40 20 73 |b@a, b =| b, a@ s|
|00001c40| 77 61 70 73 20 74 77 6f | 20 76 61 72 69 61 62 6c |waps two| variabl|
|00001c50| 65 73 29 2c 20 6f 76 65 | 72 6c 61 70 73 20 77 69 |es), ove|rlaps wi|
|00001c60| 74 68 69 6e 20 74 68 65 | 0d 63 6f 6c 6c 65 63 74 |thin the|.collect|
|00001c70| 69 6f 6e 20 6f 66 20 61 | 73 73 69 67 6e 65 64 2d |ion of a|ssigned-|
|00001c80| 74 6f 20 76 61 72 69 61 | 62 6c 65 73 20 61 72 65 |to varia|bles are|
|00001c90| 20 6e 6f 74 20 73 61 66 | 65 21 20 20 46 6f 72 20 | not saf|e! For |
|00001ca0| 69 6e 73 74 61 6e 63 65 | 2c 20 74 68 65 0d 66 6f |instance|, the.fo|
|00001cb0| 6c 6c 6f 77 69 6e 67 20 | 70 72 6f 67 72 61 6d 20 |llowing |program |
|00001cc0| 70 72 69 6e 74 73 20 5c | 63 6f 64 65 40 5b 30 2c |prints \|code@[0,|
|00001cd0| 20 32 5d 40 3a 0d 0d 5c | 62 65 67 69 6e 7b 76 65 | 2]@:..\|begin{ve|
|00001ce0| 72 62 61 74 69 6d 7d 0d | 78 20 3d 20 5b 30 2c 20 |rbatim}.|x = [0, |
|00001cf0| 31 5d 0d 69 20 3d 20 30 | 0d 69 2c 20 78 5b 69 5d |1].i = 0|.i, x[i]|
|00001d00| 20 3d 20 31 2c 20 32 0d | 70 72 69 6e 74 20 78 0d | = 1, 2.|print x.|
|00001d10| 5c 65 6e 64 7b 76 65 72 | 62 61 74 69 6d 7d 0d 0d |\end{ver|batim}..|
|00001d20| 0d 5c 73 65 63 74 69 6f | 6e 7b 54 68 65 20 7b 5c |.\sectio|n{The {\|
|00001d30| 74 74 20 70 61 73 73 7d | 20 73 74 61 74 65 6d 65 |tt pass}| stateme|
|00001d40| 6e 74 7d 0d 5c 73 74 69 | 6e 64 65 78 7b 70 61 73 |nt}.\sti|ndex{pas|
|00001d50| 73 7d 0d 0d 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |s}..\beg|in{verba|
|00001d60| 74 69 6d 7d 0d 70 61 73 | 73 5f 73 74 6d 74 3a 20 |tim}.pas|s_stmt: |
|00001d70| 20 20 20 20 20 22 70 61 | 73 73 22 0d 5c 65 6e 64 | "pa|ss".\end|
|00001d80| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0d 5c 76 65 72 |{verbati|m}..\ver|
|00001d90| 62 40 70 61 73 73 40 20 | 69 73 20 61 20 6e 75 6c |b@pass@ |is a nul|
|00001da0| 6c 20 6f 70 65 72 61 74 | 69 6f 6e 20 2d 2d 2d 20 |l operat|ion --- |
|00001db0| 77 68 65 6e 20 69 74 20 | 69 73 20 65 78 65 63 75 |when it |is execu|
|00001dc0| 74 65 64 2c 20 6e 6f 74 | 68 69 6e 67 0d 68 61 70 |ted, not|hing.hap|
|00001dd0| 70 65 6e 73 2e 20 20 49 | 74 20 69 73 20 75 73 65 |pens. I|t is use|
|00001de0| 66 75 6c 20 61 73 20 61 | 20 70 6c 61 63 65 68 6f |ful as a| placeho|
|00001df0| 6c 64 65 72 20 77 68 65 | 6e 20 61 20 73 74 61 74 |lder whe|n a stat|
|00001e00| 65 6d 65 6e 74 20 69 73 | 0d 72 65 71 75 69 72 65 |ement is|.require|
|00001e10| 64 20 73 79 6e 74 61 63 | 74 69 63 61 6c 6c 79 2c |d syntac|tically,|
|00001e20| 20 62 75 74 20 6e 6f 20 | 63 6f 64 65 20 6e 65 65 | but no |code nee|
|00001e30| 64 73 20 74 6f 20 62 65 | 20 65 78 65 63 75 74 65 |ds to be| execute|
|00001e40| 64 2c 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 3a 0d |d, for e|xample:.|
|00001e50| 5c 69 6e 64 65 78 69 69 | 7b 6e 75 6c 6c 7d 7b 6f |\indexii|{null}{o|
|00001e60| 70 65 72 61 74 69 6f 6e | 7d 0d 0d 5c 62 65 67 69 |peration|}..\begi|
|00001e70| 6e 7b 76 65 72 62 61 74 | 69 6d 7d 0d 64 65 66 20 |n{verbat|im}.def |
|00001e80| 66 28 61 72 67 29 3a 20 | 70 61 73 73 20 20 20 20 |f(arg): |pass |
|00001e90| 23 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 74 68 61 |# a func|tion tha|
|00001ea0| 74 20 64 6f 65 73 20 6e | 6f 74 68 69 6e 67 20 28 |t does n|othing (|
|00001eb0| 79 65 74 29 0d 0d 63 6c | 61 73 73 20 43 3a 20 70 |yet)..cl|ass C: p|
|00001ec0| 61 73 73 20 20 20 20 20 | 20 20 23 20 61 6e 20 63 |ass | # an c|
|00001ed0| 6c 61 73 73 20 77 69 74 | 68 20 6e 6f 20 6d 65 74 |lass wit|h no met|
|00001ee0| 68 6f 64 73 20 28 79 65 | 74 29 0d 5c 65 6e 64 7b |hods (ye|t).\end{|
|00001ef0| 76 65 72 62 61 74 69 6d | 7d 0d 0d 5c 73 65 63 74 |verbatim|}..\sect|
|00001f00| 69 6f 6e 7b 54 68 65 20 | 7b 5c 74 74 20 64 65 6c |ion{The |{\tt del|
|00001f10| 7d 20 73 74 61 74 65 6d | 65 6e 74 7d 0d 5c 73 74 |} statem|ent}.\st|
|00001f20| 69 6e 64 65 78 7b 64 65 | 6c 7d 0d 0d 5c 62 65 67 |index{de|l}..\beg|
|00001f30| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0d 64 65 6c |in{verba|tim}.del|
|00001f40| 5f 73 74 6d 74 3a 20 20 | 20 20 20 20 20 22 64 65 |_stmt: | "de|
|00001f50| 6c 22 20 74 61 72 67 65 | 74 5f 6c 69 73 74 0d 5c |l" targe|t_list.\|
|00001f60| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0d 0d 44 |end{verb|atim}..D|
|00001f70| 65 6c 65 74 69 6f 6e 20 | 69 73 20 72 65 63 75 72 |eletion |is recur|
|00001f80| 73 69 76 65 6c 79 20 64 | 65 66 69 6e 65 64 20 76 |sively d|efined v|
|00001f90| 65 72 79 20 73 69 6d 69 | 6c 61 72 20 74 6f 20 74 |ery simi|lar to t|
|00001fa0| 68 65 20 77 61 79 20 61 | 73 73 69 67 6e 6d 65 6e |he way a|ssignmen|
|00001fb0| 74 20 69 73 0d 64 65 66 | 69 6e 65 64 2e 20 52 61 |t is.def|ined. Ra|
|00001fc0| 74 68 65 72 20 74 68 61 | 74 20 73 70 65 6c 6c 69 |ther tha|t spelli|
|00001fd0| 6e 67 20 69 74 20 6f 75 | 74 20 69 6e 20 66 75 6c |ng it ou|t in ful|
|00001fe0| 6c 20 64 65 74 61 69 6c | 73 2c 20 68 65 72 65 20 |l detail|s, here |
|00001ff0| 61 72 65 20 73 6f 6d 65 | 0d 68 69 6e 74 73 2e 0d |are some|.hints..|
|00002000| 5c 69 6e 64 65 78 69 69 | 7b 64 65 6c 65 74 69 6f |\indexii|{deletio|
|00002010| 6e 7d 7b 74 61 72 67 65 | 74 7d 0d 5c 69 6e 64 65 |n}{targe|t}.\inde|
|00002020| 78 69 69 69 7b 64 65 6c | 65 74 69 6f 6e 7d 7b 74 |xiii{del|etion}{t|
|00002030| 61 72 67 65 74 7d 7b 6c | 69 73 74 7d 0d 0d 44 65 |arget}{l|ist}..De|
|00002040| 6c 65 74 69 6f 6e 20 6f | 66 20 61 20 74 61 72 67 |letion o|f a targ|
|00002050| 65 74 20 6c 69 73 74 20 | 72 65 63 75 72 73 69 76 |et list |recursiv|
|00002060| 65 6c 79 20 64 65 6c 65 | 74 65 73 20 65 61 63 68 |ely dele|tes each|
|00002070| 20 74 61 72 67 65 74 2c | 20 66 72 6f 6d 20 6c 65 | target,| from le|
|00002080| 66 74 0d 74 6f 20 72 69 | 67 68 74 2e 0d 0d 44 65 |ft.to ri|ght...De|
|00002090| 6c 65 74 69 6f 6e 20 6f | 66 20 61 20 6e 61 6d 65 |letion o|f a name|
|000020a0| 20 72 65 6d 6f 76 65 73 | 20 74 68 65 20 62 69 6e | removes| the bin|
|000020b0| 64 69 6e 67 20 6f 66 20 | 74 68 61 74 20 6e 61 6d |ding of |that nam|
|000020c0| 65 20 28 77 68 69 63 68 | 20 6d 75 73 74 20 65 78 |e (which| must ex|
|000020d0| 69 73 74 29 0d 66 72 6f | 6d 20 74 68 65 20 6c 6f |ist).fro|m the lo|
|000020e0| 63 61 6c 20 6f 72 20 67 | 6c 6f 62 61 6c 20 6e 61 |cal or g|lobal na|
|000020f0| 6d 65 20 73 70 61 63 65 | 2c 20 64 65 70 65 6e 64 |me space|, depend|
|00002100| 69 6e 67 20 6f 6e 20 77 | 68 65 74 68 65 72 20 74 |ing on w|hether t|
|00002110| 68 65 20 6e 61 6d 65 0d | 6f 63 63 75 72 73 20 69 |he name.|occurs i|
|00002120| 6e 20 61 20 5c 76 65 72 | 62 40 67 6c 6f 62 61 6c |n a \ver|b@global|
|00002130| 40 20 73 74 61 74 65 6d | 65 6e 74 20 69 6e 20 74 |@ statem|ent in t|
|00002140| 68 65 20 73 61 6d 65 20 | 63 6f 64 65 20 62 6c 6f |he same |code blo|
|00002150| 63 6b 2e 0d 5c 73 74 69 | 6e 64 65 78 7b 67 6c 6f |ck..\sti|ndex{glo|
|00002160| 62 61 6c 7d 0d 5c 69 6e | 64 65 78 69 69 7b 75 6e |bal}.\in|dexii{un|
|00002170| 62 69 6e 64 69 6e 67 7d | 7b 6e 61 6d 65 7d 0d 0d |binding}|{name}..|
|00002180| 44 65 6c 65 74 69 6f 6e | 20 6f 66 20 61 74 74 72 |Deletion| of attr|
|00002190| 69 62 75 74 65 20 72 65 | 66 65 72 65 6e 63 65 73 |ibute re|ferences|
|000021a0| 2c 20 73 75 62 73 63 72 | 69 70 74 69 6f 6e 73 20 |, subscr|iptions |
|000021b0| 61 6e 64 20 73 6c 69 63 | 69 6e 67 73 0d 69 73 20 |and slic|ings.is |
|000021c0| 70 61 73 73 65 64 20 74 | 6f 20 74 68 65 20 70 72 |passed t|o the pr|
|000021d0| 69 6d 61 72 79 20 6f 62 | 6a 65 63 74 20 69 6e 76 |imary ob|ject inv|
|000021e0| 6f 6c 76 65 64 3b 20 64 | 65 6c 65 74 69 6f 6e 20 |olved; d|eletion |
|000021f0| 6f 66 20 61 20 73 6c 69 | 63 69 6e 67 0d 69 73 20 |of a sli|cing.is |
|00002200| 69 6e 20 67 65 6e 65 72 | 61 6c 20 65 71 75 69 76 |in gener|al equiv|
|00002210| 61 6c 65 6e 74 20 74 6f | 20 61 73 73 69 67 6e 6d |alent to| assignm|
|00002220| 65 6e 74 20 6f 66 20 61 | 6e 20 65 6d 70 74 79 20 |ent of a|n empty |
|00002230| 73 6c 69 63 65 20 6f 66 | 20 74 68 65 0d 72 69 67 |slice of| the.rig|
|00002240| 68 74 20 74 79 70 65 20 | 28 62 75 74 20 65 76 65 |ht type |(but eve|
|00002250| 6e 20 74 68 69 73 20 69 | 73 20 64 65 74 65 72 6d |n this i|s determ|
|00002260| 69 6e 65 64 20 62 79 20 | 74 68 65 20 73 6c 69 63 |ined by |the slic|
|00002270| 65 64 20 6f 62 6a 65 63 | 74 29 2e 0d 5c 69 6e 64 |ed objec|t)..\ind|
|00002280| 65 78 69 69 7b 61 74 74 | 72 69 62 75 74 65 7d 7b |exii{att|ribute}{|
|00002290| 64 65 6c 65 74 69 6f 6e | 7d 0d 0d 5c 73 65 63 74 |deletion|}..\sect|
|000022a0| 69 6f 6e 7b 54 68 65 20 | 7b 5c 74 74 20 70 72 69 |ion{The |{\tt pri|
|000022b0| 6e 74 7d 20 73 74 61 74 | 65 6d 65 6e 74 7d 20 5c |nt} stat|ement} \|
|000022c0| 6c 61 62 65 6c 7b 70 72 | 69 6e 74 7d 0d 5c 73 74 |label{pr|int}.\st|
|000022d0| 69 6e 64 65 78 7b 70 72 | 69 6e 74 7d 0d 0d 5c 62 |index{pr|int}..\b|
|000022e0| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0d 70 |egin{ver|batim}.p|
|000022f0| 72 69 6e 74 5f 73 74 6d | 74 3a 20 20 20 20 20 22 |rint_stm|t: "|
|00002300| 70 72 69 6e 74 22 20 5b | 20 63 6f 6e 64 69 74 69 |print" [| conditi|
|00002310| 6f 6e 20 28 22 2c 22 20 | 63 6f 6e 64 69 74 69 6f |on ("," |conditio|
|00002320| 6e 29 2a 20 5b 22 2c 22 | 5d 20 5d 0d 5c 65 6e 64 |n)* [","|] ].\end|
|00002330| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0d 5c 76 65 72 |{verbati|m}..\ver|
|00002340| 62 40 70 72 69 6e 74 40 | 20 65 76 61 6c 75 61 74 |b@print@| evaluat|
|00002350| 65 73 20 65 61 63 68 20 | 63 6f 6e 64 69 74 69 6f |es each |conditio|
|00002360| 6e 20 69 6e 20 74 75 72 | 6e 20 61 6e 64 20 77 72 |n in tur|n and wr|
|00002370| 69 74 65 73 20 74 68 65 | 20 72 65 73 75 6c 74 69 |ites the| resulti|
|00002380| 6e 67 0d 6f 62 6a 65 63 | 74 20 74 6f 20 73 74 61 |ng.objec|t to sta|
|00002390| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 20 28 73 65 |ndard ou|tput (se|
|000023a0| 65 20 62 65 6c 6f 77 29 | 2e 20 20 49 66 20 61 6e |e below)|. If an|
|000023b0| 20 6f 62 6a 65 63 74 20 | 69 73 20 6e 6f 74 20 61 | object |is not a|
|000023c0| 20 73 74 72 69 6e 67 2c | 0d 69 74 20 69 73 20 66 | string,|.it is f|
|000023d0| 69 72 73 74 20 63 6f 6e | 76 65 72 74 65 64 20 74 |irst con|verted t|
|000023e0| 6f 20 61 20 73 74 72 69 | 6e 67 20 75 73 69 6e 67 |o a stri|ng using|
|000023f0| 20 74 68 65 20 72 75 6c | 65 73 20 66 6f 72 20 73 | the rul|es for s|
|00002400| 74 72 69 6e 67 0d 63 6f | 6e 76 65 72 73 69 6f 6e |tring.co|nversion|
|00002410| 73 2e 20 20 54 68 65 20 | 28 72 65 73 75 6c 74 69 |s. The |(resulti|
|00002420| 6e 67 20 6f 72 20 6f 72 | 69 67 69 6e 61 6c 29 20 |ng or or|iginal) |
|00002430| 73 74 72 69 6e 67 20 69 | 73 20 74 68 65 6e 20 77 |string i|s then w|
|00002440| 72 69 74 74 65 6e 2e 20 | 20 41 0d 73 70 61 63 65 |ritten. | A.space|
|00002450| 20 69 73 20 77 72 69 74 | 74 65 6e 20 62 65 66 6f | is writ|ten befo|
|00002460| 72 65 20 65 61 63 68 20 | 6f 62 6a 65 63 74 20 69 |re each |object i|
|00002470| 73 20 28 63 6f 6e 76 65 | 72 74 65 64 20 61 6e 64 |s (conve|rted and|
|00002480| 29 20 77 72 69 74 74 65 | 6e 2c 20 75 6e 6c 65 73 |) writte|n, unles|
|00002490| 73 0d 74 68 65 20 6f 75 | 74 70 75 74 20 73 79 73 |s.the ou|tput sys|
|000024a0| 74 65 6d 20 62 65 6c 69 | 65 76 65 73 20 69 74 20 |tem beli|eves it |
|000024b0| 69 73 20 70 6f 73 69 74 | 69 6f 6e 65 64 20 61 74 |is posit|ioned at|
|000024c0| 20 74 68 65 20 62 65 67 | 69 6e 6e 69 6e 67 20 6f | the beg|inning o|
|000024d0| 66 20 61 0d 6c 69 6e 65 | 2e 20 20 54 68 69 73 20 |f a.line|. This |
|000024e0| 69 73 20 74 68 65 20 63 | 61 73 65 3a 20 28 31 29 |is the c|ase: (1)|
|000024f0| 20 77 68 65 6e 20 6e 6f | 20 63 68 61 72 61 63 74 | when no| charact|
|00002500| 65 72 73 20 68 61 76 65 | 20 79 65 74 20 62 65 65 |ers have| yet bee|
|00002510| 6e 20 77 72 69 74 74 65 | 6e 0d 74 6f 20 73 74 61 |n writte|n.to sta|
|00002520| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 3b 20 6f 72 |ndard ou|tput; or|
|00002530| 20 28 32 29 20 77 68 65 | 6e 20 74 68 65 20 6c 61 | (2) whe|n the la|
|00002540| 73 74 20 63 68 61 72 61 | 63 74 65 72 20 77 72 69 |st chara|cter wri|
|00002550| 74 74 65 6e 20 74 6f 20 | 73 74 61 6e 64 61 72 64 |tten to |standard|
|00002560| 0d 6f 75 74 70 75 74 20 | 69 73 20 5c 76 65 72 62 |.output |is \verb|
|00002570| 2f 5c 6e 2f 3b 20 6f 72 | 20 28 33 29 20 77 68 65 |/\n/; or| (3) whe|
|00002580| 6e 20 74 68 65 20 6c 61 | 73 74 20 77 72 69 74 65 |n the la|st write|
|00002590| 20 6f 70 65 72 61 74 69 | 6f 6e 20 6f 6e 20 73 74 | operati|on on st|
|000025a0| 61 6e 64 61 72 64 0d 6f | 75 74 70 75 74 20 77 61 |andard.o|utput wa|
|000025b0| 73 20 6e 6f 74 20 61 20 | 5c 76 65 72 62 40 70 72 |s not a |\verb@pr|
|000025c0| 69 6e 74 40 20 73 74 61 | 74 65 6d 65 6e 74 2e 20 |int@ sta|tement. |
|000025d0| 20 28 49 6e 20 73 6f 6d | 65 20 63 61 73 65 73 20 | (In som|e cases |
|000025e0| 69 74 20 6d 61 79 20 62 | 65 0d 66 75 6e 63 74 69 |it may b|e.functi|
|000025f0| 6f 6e 61 6c 20 74 6f 20 | 77 72 69 74 65 20 61 6e |onal to |write an|
|00002600| 20 65 6d 70 74 79 20 73 | 74 72 69 6e 67 20 74 6f | empty s|tring to|
|00002610| 20 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 | standar|d output|
|00002620| 20 66 6f 72 20 74 68 69 | 73 0d 72 65 61 73 6f 6e | for thi|s.reason|
|00002630| 2e 29 0d 5c 69 6e 64 65 | 78 7b 6f 75 74 70 75 74 |.).\inde|x{output|
|00002640| 7d 0d 5c 69 6e 64 65 78 | 69 69 7b 77 72 69 74 69 |}.\index|ii{writi|
|00002650| 6e 67 7d 7b 76 61 6c 75 | 65 73 7d 0d 0d 41 20 5c |ng}{valu|es}..A \|
|00002660| 76 65 72 62 2f 22 5c 6e | 22 2f 20 63 68 61 72 61 |verb/"\n|"/ chara|
|00002670| 63 74 65 72 20 69 73 20 | 77 72 69 74 74 65 6e 20 |cter is |written |
|00002680| 61 74 20 74 68 65 20 65 | 6e 64 2c 20 75 6e 6c 65 |at the e|nd, unle|
|00002690| 73 73 20 74 68 65 20 5c | 76 65 72 62 40 70 72 69 |ss the \|verb@pri|
|000026a0| 6e 74 40 0d 73 74 61 74 | 65 6d 65 6e 74 20 65 6e |nt@.stat|ement en|
|000026b0| 64 73 20 77 69 74 68 20 | 61 20 63 6f 6d 6d 61 2e |ds with |a comma.|
|000026c0| 20 20 54 68 69 73 20 69 | 73 20 74 68 65 20 6f 6e | This i|s the on|
|000026d0| 6c 79 20 61 63 74 69 6f | 6e 20 69 66 20 74 68 65 |ly actio|n if the|
|000026e0| 20 73 74 61 74 65 6d 65 | 6e 74 0d 63 6f 6e 74 61 | stateme|nt.conta|
|000026f0| 69 6e 73 20 6a 75 73 74 | 20 74 68 65 20 6b 65 79 |ins just| the key|
|00002700| 77 6f 72 64 20 5c 76 65 | 72 62 40 70 72 69 6e 74 |word \ve|rb@print|
|00002710| 40 2e 0d 5c 69 6e 64 65 | 78 69 69 7b 74 72 61 69 |@..\inde|xii{trai|
|00002720| 6c 69 6e 67 7d 7b 63 6f | 6d 6d 61 7d 0d 5c 69 6e |ling}{co|mma}.\in|
|00002730| 64 65 78 69 69 7b 6e 65 | 77 6c 69 6e 65 7d 7b 73 |dexii{ne|wline}{s|
|00002740| 75 70 70 72 65 73 73 69 | 6f 6e 7d 0d 0d 53 74 61 |uppressi|on}..Sta|
|00002750| 6e 64 61 72 64 20 6f 75 | 74 70 75 74 20 69 73 20 |ndard ou|tput is |
|00002760| 64 65 66 69 6e 65 64 20 | 61 73 20 74 68 65 20 66 |defined |as the f|
|00002770| 69 6c 65 20 6f 62 6a 65 | 63 74 20 6e 61 6d 65 64 |ile obje|ct named|
|00002780| 20 5c 76 65 72 62 40 73 | 74 64 6f 75 74 40 0d 69 | \verb@s|tdout@.i|
|00002790| 6e 20 74 68 65 20 62 75 | 69 6c 74 2d 69 6e 20 6d |n the bu|ilt-in m|
|000027a0| 6f 64 75 6c 65 20 5c 76 | 65 72 62 40 73 79 73 40 |odule \v|erb@sys@|
|000027b0| 2e 20 20 49 66 20 6e 6f | 20 73 75 63 68 20 6f 62 |. If no| such ob|
|000027c0| 6a 65 63 74 20 65 78 69 | 73 74 73 2c 0d 6f 72 20 |ject exi|sts,.or |
|000027d0| 69 66 20 69 74 20 69 73 | 20 6e 6f 74 20 61 20 77 |if it is| not a w|
|000027e0| 72 69 74 61 62 6c 65 20 | 66 69 6c 65 2c 20 61 20 |ritable |file, a |
|000027f0| 5c 76 65 72 62 40 52 75 | 6e 74 69 6d 65 45 72 72 |\verb@Ru|ntimeErr|
|00002800| 6f 72 40 20 65 78 63 65 | 70 74 69 6f 6e 20 69 73 |or@ exce|ption is|
|00002810| 20 72 61 69 73 65 64 2e | 0d 28 54 68 65 20 6f 72 | raised.|.(The or|
|00002820| 69 67 69 6e 61 6c 20 69 | 6d 70 6c 65 6d 65 6e 74 |iginal i|mplement|
|00002830| 61 74 69 6f 6e 20 61 74 | 74 65 6d 70 74 73 20 74 |ation at|tempts t|
|00002840| 6f 20 77 72 69 74 65 20 | 74 6f 20 74 68 65 20 73 |o write |to the s|
|00002850| 79 73 74 65 6d 27 73 20 | 6f 72 69 67 69 6e 61 6c |ystem's |original|
|00002860| 0d 73 74 61 6e 64 61 72 | 64 20 6f 75 74 70 75 74 |.standar|d output|
|00002870| 20 69 6e 73 74 65 61 64 | 2c 20 62 75 74 20 74 68 | instead|, but th|
|00002880| 69 73 20 69 73 20 6e 6f | 74 20 73 61 66 65 2c 20 |is is no|t safe, |
|00002890| 61 6e 64 20 73 68 6f 75 | 6c 64 20 62 65 20 66 69 |and shou|ld be fi|
|000028a0| 78 65 64 2e 29 0d 5c 69 | 6e 64 65 78 69 69 7b 73 |xed.).\i|ndexii{s|
|000028b0| 74 61 6e 64 61 72 64 7d | 7b 6f 75 74 70 75 74 7d |tandard}|{output}|
|000028c0| 0d 5c 62 69 6d 6f 64 69 | 6e 64 65 78 7b 73 79 73 |.\bimodi|ndex{sys|
|000028d0| 7d 0d 5c 74 74 69 6e 64 | 65 78 7b 73 74 64 6f 75 |}.\ttind|ex{stdou|
|000028e0| 74 7d 0d 5c 65 78 69 6e | 64 65 78 7b 52 75 6e 74 |t}.\exin|dex{Runt|
|000028f0| 69 6d 65 45 72 72 6f 72 | 7d 0d 0d 5c 73 65 63 74 |imeError|}..\sect|
|00002900| 69 6f 6e 7b 54 68 65 20 | 7b 5c 74 74 20 72 65 74 |ion{The |{\tt ret|
|00002910| 75 72 6e 7d 20 73 74 61 | 74 65 6d 65 6e 74 7d 0d |urn} sta|tement}.|
|00002920| 5c 73 74 69 6e 64 65 78 | 7b 72 65 74 75 72 6e 7d |\stindex|{return}|
|00002930| 0d 0d 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00002940| 6d 7d 0d 72 65 74 75 72 | 6e 5f 73 74 6d 74 3a 20 |m}.retur|n_stmt: |
|00002950| 20 20 20 22 72 65 74 75 | 72 6e 22 20 5b 63 6f 6e | "retu|rn" [con|
|00002960| 64 69 74 69 6f 6e 5f 6c | 69 73 74 5d 0d 5c 65 6e |dition_l|ist].\en|
|00002970| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0d 0d 5c 76 65 |d{verbat|im}..\ve|
|00002980| 72 62 40 72 65 74 75 72 | 6e 40 20 6d 61 79 20 6f |rb@retur|n@ may o|
|00002990| 6e 6c 79 20 6f 63 63 75 | 72 20 73 79 6e 74 61 63 |nly occu|r syntac|
|000029a0| 74 69 63 61 6c 6c 79 20 | 6e 65 73 74 65 64 20 69 |tically |nested i|
|000029b0| 6e 20 61 20 66 75 6e 63 | 74 69 6f 6e 0d 64 65 66 |n a func|tion.def|
|000029c0| 69 6e 69 74 69 6f 6e 2c | 20 6e 6f 74 20 77 69 74 |inition,| not wit|
|000029d0| 68 69 6e 20 61 20 6e 65 | 73 74 65 64 20 63 6c 61 |hin a ne|sted cla|
|000029e0| 73 73 20 64 65 66 69 6e | 69 74 69 6f 6e 2e 0d 5c |ss defin|ition..\|
|000029f0| 69 6e 64 65 78 69 69 7b | 66 75 6e 63 74 69 6f 6e |indexii{|function|
|00002a00| 7d 7b 64 65 66 69 6e 69 | 74 69 6f 6e 7d 0d 5c 69 |}{defini|tion}.\i|
|00002a10| 6e 64 65 78 69 69 7b 63 | 6c 61 73 73 7d 7b 64 65 |ndexii{c|lass}{de|
|00002a20| 66 69 6e 69 74 69 6f 6e | 7d 0d 0d 49 66 20 61 20 |finition|}..If a |
|00002a30| 63 6f 6e 64 69 74 69 6f | 6e 20 6c 69 73 74 20 69 |conditio|n list i|
|00002a40| 73 20 70 72 65 73 65 6e | 74 2c 20 69 74 20 69 73 |s presen|t, it is|
|00002a50| 20 65 76 61 6c 75 61 74 | 65 64 2c 20 65 6c 73 65 | evaluat|ed, else|
|00002a60| 20 5c 76 65 72 62 40 4e | 6f 6e 65 40 0d 69 73 20 | \verb@N|one@.is |
|00002a70| 73 75 62 73 74 69 74 75 | 74 65 64 2e 0d 0d 5c 76 |substitu|ted...\v|
|00002a80| 65 72 62 40 72 65 74 75 | 72 6e 40 20 6c 65 61 76 |erb@retu|rn@ leav|
|00002a90| 65 73 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 66 |es the c|urrent f|
|00002aa0| 75 6e 63 74 69 6f 6e 20 | 63 61 6c 6c 20 77 69 74 |unction |call wit|
|00002ab0| 68 20 74 68 65 20 63 6f | 6e 64 69 74 69 6f 6e 0d |h the co|ndition.|
|00002ac0| 6c 69 73 74 20 28 6f 72 | 20 5c 76 65 72 62 40 4e |list (or| \verb@N|
|00002ad0| 6f 6e 65 40 29 20 61 73 | 20 72 65 74 75 72 6e 20 |one@) as| return |
|00002ae0| 76 61 6c 75 65 2e 0d 0d | 57 68 65 6e 20 5c 76 65 |value...|When \ve|
|00002af0| 72 62 40 72 65 74 75 72 | 6e 40 20 70 61 73 73 65 |rb@retur|n@ passe|
|00002b00| 73 20 63 6f 6e 74 72 6f | 6c 20 6f 75 74 20 6f 66 |s contro|l out of|
|00002b10| 20 61 20 5c 76 65 72 62 | 40 74 72 79 40 20 73 74 | a \verb|@try@ st|
|00002b20| 61 74 65 6d 65 6e 74 0d | 77 69 74 68 20 61 20 5c |atement.|with a \|
|00002b30| 76 65 72 62 40 66 69 6e | 61 6c 6c 79 40 20 63 6c |verb@fin|ally@ cl|
|00002b40| 61 75 73 65 2c 20 74 68 | 61 74 20 66 69 6e 61 6c |ause, th|at final|
|00002b50| 6c 79 20 63 6c 61 75 73 | 65 20 69 73 20 65 78 65 |ly claus|e is exe|
|00002b60| 63 75 74 65 64 0d 62 65 | 66 6f 72 65 20 72 65 61 |cuted.be|fore rea|
|00002b70| 6c 6c 79 20 6c 65 61 76 | 69 6e 67 20 74 68 65 20 |lly leav|ing the |
|00002b80| 66 75 6e 63 74 69 6f 6e | 2e 0d 5c 6b 77 69 6e 64 |function|..\kwind|
|00002b90| 65 78 7b 66 69 6e 61 6c | 6c 79 7d 0d 0d 5c 73 65 |ex{final|ly}..\se|
|00002ba0| 63 74 69 6f 6e 7b 54 68 | 65 20 7b 5c 74 74 20 72 |ction{Th|e {\tt r|
|00002bb0| 61 69 73 65 7d 20 73 74 | 61 74 65 6d 65 6e 74 7d |aise} st|atement}|
|00002bc0| 0d 5c 73 74 69 6e 64 65 | 78 7b 72 61 69 73 65 7d |.\stinde|x{raise}|
|00002bd0| 0d 0d 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00002be0| 6d 7d 0d 72 61 69 73 65 | 5f 73 74 6d 74 3a 20 20 |m}.raise|_stmt: |
|00002bf0| 20 20 20 22 72 61 69 73 | 65 22 20 63 6f 6e 64 69 | "rais|e" condi|
|00002c00| 74 69 6f 6e 20 5b 22 2c | 22 20 63 6f 6e 64 69 74 |tion [",|" condit|
|00002c10| 69 6f 6e 5d 0d 5c 65 6e | 64 7b 76 65 72 62 61 74 |ion].\en|d{verbat|
|00002c20| 69 6d 7d 0d 0d 5c 76 65 | 72 62 40 72 61 69 73 65 |im}..\ve|rb@raise|
|00002c30| 40 20 65 76 61 6c 75 61 | 74 65 73 20 69 74 73 20 |@ evalua|tes its |
|00002c40| 66 69 72 73 74 20 63 6f | 6e 64 69 74 69 6f 6e 2c |first co|ndition,|
|00002c50| 20 77 68 69 63 68 20 6d | 75 73 74 20 79 69 65 6c | which m|ust yiel|
|00002c60| 64 0d 61 20 73 74 72 69 | 6e 67 20 6f 62 6a 65 63 |d.a stri|ng objec|
|00002c70| 74 2e 20 20 49 66 20 74 | 68 65 72 65 20 69 73 20 |t. If t|here is |
|00002c80| 61 20 73 65 63 6f 6e 64 | 20 63 6f 6e 64 69 74 69 |a second| conditi|
|00002c90| 6f 6e 2c 20 74 68 69 73 | 20 69 73 20 65 76 61 6c |on, this| is eval|
|00002ca0| 75 61 74 65 64 2c 0d 65 | 6c 73 65 20 5c 76 65 72 |uated,.e|lse \ver|
|00002cb0| 62 40 4e 6f 6e 65 40 20 | 69 73 20 73 75 62 73 74 |b@None@ |is subst|
|00002cc0| 69 74 75 74 65 64 2e 0d | 5c 69 6e 64 65 78 7b 65 |ituted..|\index{e|
|00002cd0| 78 63 65 70 74 69 6f 6e | 7d 0d 5c 69 6e 64 65 78 |xception|}.\index|
|00002ce0| 69 69 7b 72 61 69 73 69 | 6e 67 7d 7b 65 78 63 65 |ii{raisi|ng}{exce|
|00002cf0| 70 74 69 6f 6e 7d 0d 0d | 49 74 20 74 68 65 6e 20 |ption}..|It then |
|00002d00| 72 61 69 73 65 73 20 74 | 68 65 20 65 78 63 65 70 |raises t|he excep|
|00002d10| 74 69 6f 6e 20 69 64 65 | 6e 74 69 66 69 65 64 20 |tion ide|ntified |
|00002d20| 62 79 20 74 68 65 20 66 | 69 72 73 74 20 6f 62 6a |by the f|irst obj|
|00002d30| 65 63 74 2c 0d 77 69 74 | 68 20 74 68 65 20 73 65 |ect,.wit|h the se|
|00002d40| 63 6f 6e 64 20 6f 6e 65 | 20 28 6f 72 20 5c 76 65 |cond one| (or \ve|
|00002d50| 72 62 40 4e 6f 6e 65 40 | 29 20 61 73 20 69 74 73 |rb@None@|) as its|
|00002d60| 20 70 61 72 61 6d 65 74 | 65 72 2e 0d 0d 5c 73 65 | paramet|er...\se|
|00002d70| 63 74 69 6f 6e 7b 54 68 | 65 20 7b 5c 74 74 20 62 |ction{Th|e {\tt b|
|00002d80| 72 65 61 6b 7d 20 73 74 | 61 74 65 6d 65 6e 74 7d |reak} st|atement}|
|00002d90| 0d 5c 73 74 69 6e 64 65 | 78 7b 62 72 65 61 6b 7d |.\stinde|x{break}|
|00002da0| 0d 0d 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00002db0| 6d 7d 0d 62 72 65 61 6b | 5f 73 74 6d 74 3a 20 20 |m}.break|_stmt: |
|00002dc0| 20 20 20 22 62 72 65 61 | 6b 22 0d 5c 65 6e 64 7b | "brea|k".\end{|
|00002dd0| 76 65 72 62 61 74 69 6d | 7d 0d 0d 5c 76 65 72 62 |verbatim|}..\verb|
|00002de0| 40 62 72 65 61 6b 40 20 | 6d 61 79 20 6f 6e 6c 79 |@break@ |may only|
|00002df0| 20 6f 63 63 75 72 20 73 | 79 6e 74 61 63 74 69 63 | occur s|yntactic|
|00002e00| 61 6c 6c 79 20 6e 65 73 | 74 65 64 20 69 6e 20 61 |ally nes|ted in a|
|00002e10| 20 5c 76 65 72 62 40 66 | 6f 72 40 0d 6f 72 20 5c | \verb@f|or@.or \|
|00002e20| 76 65 72 62 40 77 68 69 | 6c 65 40 20 6c 6f 6f 70 |verb@whi|le@ loop|
|00002e30| 2c 20 62 75 74 20 6e 6f | 74 20 6e 65 73 74 65 64 |, but no|t nested|
|00002e40| 20 69 6e 20 61 20 66 75 | 6e 63 74 69 6f 6e 20 6f | in a fu|nction o|
|00002e50| 72 20 63 6c 61 73 73 20 | 64 65 66 69 6e 69 74 69 |r class |definiti|
|00002e60| 6f 6e 0d 77 69 74 68 69 | 6e 20 74 68 61 74 20 6c |on.withi|n that l|
|00002e70| 6f 6f 70 2e 0d 5c 73 74 | 69 6e 64 65 78 7b 66 6f |oop..\st|index{fo|
|00002e80| 72 7d 0d 5c 73 74 69 6e | 64 65 78 7b 77 68 69 6c |r}.\stin|dex{whil|
|00002e90| 65 7d 0d 5c 69 6e 64 65 | 78 69 69 7b 6c 6f 6f 70 |e}.\inde|xii{loop|
|00002ea0| 7d 7b 73 74 61 74 65 6d | 65 6e 74 7d 0d 0d 49 74 |}{statem|ent}..It|
|00002eb0| 20 74 65 72 6d 69 6e 61 | 74 65 73 20 74 68 65 20 | termina|tes the |
|00002ec0| 6e 65 61 72 65 73 74 20 | 65 6e 63 6c 6f 73 69 6e |nearest |enclosin|
|00002ed0| 67 20 6c 6f 6f 70 2c 20 | 73 6b 69 70 70 69 6e 67 |g loop, |skipping|
|00002ee0| 20 74 68 65 20 6f 70 74 | 69 6f 6e 61 6c 0d 5c 76 | the opt|ional.\v|
|00002ef0| 65 72 62 40 65 6c 73 65 | 40 20 63 6c 61 75 73 65 |erb@else|@ clause|
|00002f00| 20 69 66 20 74 68 65 20 | 6c 6f 6f 70 20 68 61 73 | if the |loop has|
|00002f10| 20 6f 6e 65 2e 0d 5c 6b | 77 69 6e 64 65 78 7b 65 | one..\k|windex{e|
|00002f20| 6c 73 65 7d 0d 0d 49 66 | 20 61 20 5c 76 65 72 62 |lse}..If| a \verb|
|00002f30| 40 66 6f 72 40 20 6c 6f | 6f 70 20 69 73 20 74 65 |@for@ lo|op is te|
|00002f40| 72 6d 69 6e 61 74 65 64 | 20 62 79 20 5c 76 65 72 |rminated| by \ver|
|00002f50| 62 40 62 72 65 61 6b 40 | 2c 20 74 68 65 20 6c 6f |b@break@|, the lo|
|00002f60| 6f 70 20 63 6f 6e 74 72 | 6f 6c 0d 74 61 72 67 65 |op contr|ol.targe|
|00002f70| 74 20 6b 65 65 70 73 20 | 69 74 73 20 63 75 72 72 |t keeps |its curr|
|00002f80| 65 6e 74 20 76 61 6c 75 | 65 2e 0d 5c 69 6e 64 65 |ent valu|e..\inde|
|00002f90| 78 69 69 7b 6c 6f 6f 70 | 20 63 6f 6e 74 72 6f 6c |xii{loop| control|
|00002fa0| 7d 7b 74 61 72 67 65 74 | 7d 0d 0d 57 68 65 6e 20 |}{target|}..When |
|00002fb0| 5c 76 65 72 62 40 62 72 | 65 61 6b 40 20 70 61 73 |\verb@br|eak@ pas|
|00002fc0| 73 65 73 20 63 6f 6e 74 | 72 6f 6c 20 6f 75 74 20 |ses cont|rol out |
|00002fd0| 6f 66 20 61 20 5c 76 65 | 72 62 40 74 72 79 40 20 |of a \ve|rb@try@ |
|00002fe0| 73 74 61 74 65 6d 65 6e | 74 0d 77 69 74 68 20 61 |statemen|t.with a|
|00002ff0| 20 5c 76 65 72 62 40 66 | 69 6e 61 6c 6c 79 40 20 | \verb@f|inally@ |
|00003000| 63 6c 61 75 73 65 2c 20 | 74 68 61 74 20 66 69 6e |clause, |that fin|
|00003010| 61 6c 6c 79 20 63 6c 61 | 75 73 65 20 69 73 20 65 |ally cla|use is e|
|00003020| 78 65 63 75 74 65 64 0d | 62 65 66 6f 72 65 20 72 |xecuted.|before r|
|00003030| 65 61 6c 6c 79 20 6c 65 | 61 76 69 6e 67 20 74 68 |eally le|aving th|
|00003040| 65 20 6c 6f 6f 70 2e 0d | 5c 6b 77 69 6e 64 65 78 |e loop..|\kwindex|
|00003050| 7b 66 69 6e 61 6c 6c 79 | 7d 0d 0d 5c 73 65 63 74 |{finally|}..\sect|
|00003060| 69 6f 6e 7b 54 68 65 20 | 7b 5c 74 74 20 63 6f 6e |ion{The |{\tt con|
|00003070| 74 69 6e 75 65 7d 20 73 | 74 61 74 65 6d 65 6e 74 |tinue} s|tatement|
|00003080| 7d 0d 5c 73 74 69 6e 64 | 65 78 7b 63 6f 6e 74 69 |}.\stind|ex{conti|
|00003090| 6e 75 65 7d 0d 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |nue}..\b|egin{ver|
|000030a0| 62 61 74 69 6d 7d 0d 63 | 6f 6e 74 69 6e 75 65 5f |batim}.c|ontinue_|
|000030b0| 73 74 6d 74 3a 20 20 22 | 63 6f 6e 74 69 6e 75 65 |stmt: "|continue|
|000030c0| 22 0d 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |".\end{v|erbatim}|
|000030d0| 0d 0d 5c 76 65 72 62 40 | 63 6f 6e 74 69 6e 75 65 |..\verb@|continue|
|000030e0| 40 20 6d 61 79 20 6f 6e | 6c 79 20 6f 63 63 75 72 |@ may on|ly occur|
|000030f0| 20 73 79 6e 74 61 63 74 | 69 63 61 6c 6c 79 20 6e | syntact|ically n|
|00003100| 65 73 74 65 64 20 69 6e | 20 61 20 5c 76 65 72 62 |ested in| a \verb|
|00003110| 40 66 6f 72 40 20 6f 72 | 0d 5c 76 65 72 62 40 77 |@for@ or|.\verb@w|
|00003120| 68 69 6c 65 40 20 6c 6f | 6f 70 2c 20 62 75 74 20 |hile@ lo|op, but |
|00003130| 6e 6f 74 20 6e 65 73 74 | 65 64 20 69 6e 20 61 20 |not nest|ed in a |
|00003140| 66 75 6e 63 74 69 6f 6e | 20 6f 72 20 63 6c 61 73 |function| or clas|
|00003150| 73 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 6f 72 0d |s defini|tion or.|
|00003160| 5c 76 65 72 62 40 74 72 | 79 40 20 73 74 61 74 65 |\verb@tr|y@ state|
|00003170| 6d 65 6e 74 20 77 69 74 | 68 69 6e 20 74 68 61 74 |ment wit|hin that|
|00003180| 20 6c 6f 6f 70 2e 5c 66 | 6f 6f 74 6e 6f 74 65 7b | loop.\f|ootnote{|
|00003190| 45 78 63 65 70 74 20 74 | 68 61 74 20 69 74 20 6d |Except t|hat it m|
|000031a0| 61 79 0d 63 75 72 72 65 | 6e 74 6c 79 20 6f 63 63 |ay.curre|ntly occ|
|000031b0| 75 72 20 77 69 74 68 69 | 6e 20 61 6e 20 5c 76 65 |ur withi|n an \ve|
|000031c0| 72 62 40 65 78 63 65 70 | 74 40 20 63 6c 61 75 73 |rb@excep|t@ claus|
|000031d0| 65 2e 7d 0d 5c 73 74 69 | 6e 64 65 78 7b 66 6f 72 |e.}.\sti|ndex{for|
|000031e0| 7d 0d 5c 73 74 69 6e 64 | 65 78 7b 77 68 69 6c 65 |}.\stind|ex{while|
|000031f0| 7d 0d 5c 69 6e 64 65 78 | 69 69 7b 6c 6f 6f 70 7d |}.\index|ii{loop}|
|00003200| 7b 73 74 61 74 65 6d 65 | 6e 74 7d 0d 5c 6b 77 69 |{stateme|nt}.\kwi|
|00003210| 6e 64 65 78 7b 66 69 6e | 61 6c 6c 79 7d 0d 0d 49 |ndex{fin|ally}..I|
|00003220| 74 20 63 6f 6e 74 69 6e | 75 65 73 20 77 69 74 68 |t contin|ues with|
|00003230| 20 74 68 65 20 6e 65 78 | 74 20 63 79 63 6c 65 20 | the nex|t cycle |
|00003240| 6f 66 20 74 68 65 20 6e | 65 61 72 65 73 74 20 65 |of the n|earest e|
|00003250| 6e 63 6c 6f 73 69 6e 67 | 20 6c 6f 6f 70 2e 0d 0d |nclosing| loop...|
|00003260| 5c 73 65 63 74 69 6f 6e | 7b 54 68 65 20 7b 5c 74 |\section|{The {\t|
|00003270| 74 20 69 6d 70 6f 72 74 | 7d 20 73 74 61 74 65 6d |t import|} statem|
|00003280| 65 6e 74 7d 20 5c 6c 61 | 62 65 6c 7b 69 6d 70 6f |ent} \la|bel{impo|
|00003290| 72 74 7d 0d 5c 73 74 69 | 6e 64 65 78 7b 69 6d 70 |rt}.\sti|ndex{imp|
|000032a0| 6f 72 74 7d 0d 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |ort}..\b|egin{ver|
|000032b0| 62 61 74 69 6d 7d 0d 69 | 6d 70 6f 72 74 5f 73 74 |batim}.i|mport_st|
|000032c0| 6d 74 3a 20 20 20 20 22 | 69 6d 70 6f 72 74 22 20 |mt: "|import" |
|000032d0| 69 64 65 6e 74 69 66 69 | 65 72 20 28 22 2c 22 20 |identifi|er ("," |
|000032e0| 69 64 65 6e 74 69 66 69 | 65 72 29 2a 0d 20 20 20 |identifi|er)*. |
|000032f0| 20 20 20 20 20 20 20 20 | 20 20 20 7c 20 22 66 72 | | | "fr|
|00003300| 6f 6d 22 20 69 64 65 6e | 74 69 66 69 65 72 20 22 |om" iden|tifier "|
|00003310| 69 6d 70 6f 72 74 22 20 | 69 64 65 6e 74 69 66 69 |import" |identifi|
|00003320| 65 72 20 28 22 2c 22 20 | 69 64 65 6e 74 69 66 69 |er ("," |identifi|
|00003330| 65 72 29 2a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |er)*. | |
|00003340| 20 20 20 7c 20 22 66 72 | 6f 6d 22 20 69 64 65 6e | | "fr|om" iden|
|00003350| 74 69 66 69 65 72 20 22 | 69 6d 70 6f 72 74 22 20 |tifier "|import" |
|00003360| 22 2a 22 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |"*".\end|{verbati|
|00003370| 6d 7d 0d 0d 49 6d 70 6f | 72 74 20 73 74 61 74 65 |m}..Impo|rt state|
|00003380| 6d 65 6e 74 73 20 61 72 | 65 20 65 78 65 63 75 74 |ments ar|e execut|
|00003390| 65 64 20 69 6e 20 74 77 | 6f 20 73 74 65 70 73 3a |ed in tw|o steps:|
|000033a0| 20 28 31 29 20 66 69 6e | 64 20 61 20 6d 6f 64 75 | (1) fin|d a modu|
|000033b0| 6c 65 2c 20 61 6e 64 0d | 69 6e 69 74 69 61 6c 69 |le, and.|initiali|
|000033c0| 7a 65 20 69 74 20 69 66 | 20 6e 65 63 65 73 73 61 |ze it if| necessa|
|000033d0| 72 79 3b 20 28 32 29 20 | 64 65 66 69 6e 65 20 61 |ry; (2) |define a|
|000033e0| 20 6e 61 6d 65 20 6f 72 | 20 6e 61 6d 65 73 20 69 | name or| names i|
|000033f0| 6e 20 74 68 65 20 6c 6f | 63 61 6c 0d 6e 61 6d 65 |n the lo|cal.name|
|00003400| 20 73 70 61 63 65 20 28 | 6f 66 20 74 68 65 20 73 | space (|of the s|
|00003410| 63 6f 70 65 20 77 68 65 | 72 65 20 74 68 65 20 5c |cope whe|re the \|
|00003420| 76 65 72 62 40 69 6d 70 | 6f 72 74 40 20 73 74 61 |verb@imp|ort@ sta|
|00003430| 74 65 6d 65 6e 74 20 6f | 63 63 75 72 73 29 2e 0d |tement o|ccurs)..|
|00003440| 54 68 65 20 66 69 72 73 | 74 20 66 6f 72 6d 20 28 |The firs|t form (|
|00003450| 77 69 74 68 6f 75 74 20 | 5c 76 65 72 62 40 66 72 |without |\verb@fr|
|00003460| 6f 6d 40 29 20 72 65 70 | 65 61 74 73 20 74 68 65 |om@) rep|eats the|
|00003470| 73 65 20 73 74 65 70 73 | 20 66 6f 72 20 65 61 63 |se steps| for eac|
|00003480| 68 0d 69 64 65 6e 74 69 | 66 69 65 72 20 69 6e 20 |h.identi|fier in |
|00003490| 74 68 65 20 6c 69 73 74 | 2c 20 74 68 65 20 5c 76 |the list|, the \v|
|000034a0| 65 72 62 40 66 72 6f 6d | 40 20 66 6f 72 6d 20 70 |erb@from|@ form p|
|000034b0| 65 72 66 6f 72 6d 73 20 | 74 68 65 6d 20 6f 6e 63 |erforms |them onc|
|000034c0| 65 2c 20 77 69 74 68 0d | 74 68 65 20 66 69 72 73 |e, with.|the firs|
|000034d0| 74 20 69 64 65 6e 74 69 | 66 69 65 72 20 73 70 65 |t identi|fier spe|
|000034e0| 63 69 66 79 69 6e 67 20 | 74 68 65 20 6d 6f 64 75 |cifying |the modu|
|000034f0| 6c 65 20 6e 61 6d 65 2e | 0d 5c 69 6e 64 65 78 69 |le name.|.\indexi|
|00003500| 69 7b 69 6d 70 6f 72 74 | 69 6e 67 7d 7b 6d 6f 64 |i{import|ing}{mod|
|00003510| 75 6c 65 7d 0d 5c 69 6e | 64 65 78 69 69 7b 6e 61 |ule}.\in|dexii{na|
|00003520| 6d 65 7d 7b 62 69 6e 64 | 69 6e 67 7d 0d 5c 6b 77 |me}{bind|ing}.\kw|
|00003530| 69 6e 64 65 78 7b 66 72 | 6f 6d 7d 0d 0d 54 68 65 |index{fr|om}..The|
|00003540| 20 73 79 73 74 65 6d 20 | 6d 61 69 6e 74 61 69 6e | system |maintain|
|00003550| 73 20 61 20 74 61 62 6c | 65 20 6f 66 20 6d 6f 64 |s a tabl|e of mod|
|00003560| 75 6c 65 73 20 74 68 61 | 74 20 68 61 76 65 20 62 |ules tha|t have b|
|00003570| 65 65 6e 20 69 6e 69 74 | 69 61 6c 69 7a 65 64 2c |een init|ialized,|
|00003580| 0d 69 6e 64 65 78 65 64 | 20 62 79 20 6d 6f 64 75 |.indexed| by modu|
|00003590| 6c 65 20 6e 61 6d 65 2e | 20 20 28 54 68 65 20 63 |le name.| (The c|
|000035a0| 75 72 72 65 6e 74 20 69 | 6d 70 6c 65 6d 65 6e 74 |urrent i|mplement|
|000035b0| 61 74 69 6f 6e 20 6d 61 | 6b 65 73 20 74 68 69 73 |ation ma|kes this|
|000035c0| 20 74 61 62 6c 65 0d 61 | 63 63 65 73 73 69 62 6c | table.a|ccessibl|
|000035d0| 65 20 61 73 20 5c 76 65 | 72 62 40 73 79 73 2e 6d |e as \ve|rb@sys.m|
|000035e0| 6f 64 75 6c 65 73 40 2e | 29 20 20 57 68 65 6e 20 |odules@.|) When |
|000035f0| 61 20 6d 6f 64 75 6c 65 | 20 6e 61 6d 65 20 69 73 |a module| name is|
|00003600| 20 66 6f 75 6e 64 20 69 | 6e 0d 74 68 69 73 20 74 | found i|n.this t|
|00003610| 61 62 6c 65 2c 20 73 74 | 65 70 20 28 31 29 20 69 |able, st|ep (1) i|
|00003620| 73 20 66 69 6e 69 73 68 | 65 64 2e 20 20 49 66 20 |s finish|ed. If |
|00003630| 6e 6f 74 2c 20 61 20 73 | 65 61 72 63 68 20 66 6f |not, a s|earch fo|
|00003640| 72 20 61 20 6d 6f 64 75 | 6c 65 0d 64 65 66 69 6e |r a modu|le.defin|
|00003650| 69 74 69 6f 6e 20 69 73 | 20 73 74 61 72 74 65 64 |ition is| started|
|00003660| 2e 20 20 54 68 69 73 20 | 66 69 72 73 74 20 6c 6f |. This |first lo|
|00003670| 6f 6b 73 20 66 6f 72 20 | 61 20 62 75 69 6c 74 2d |oks for |a built-|
|00003680| 69 6e 20 6d 6f 64 75 6c | 65 0d 64 65 66 69 6e 69 |in modul|e.defini|
|00003690| 74 69 6f 6e 2c 20 61 6e | 64 20 69 66 20 6e 6f 20 |tion, an|d if no |
|000036a0| 62 75 69 6c 74 2d 69 6e | 20 6d 6f 64 75 6c 65 20 |built-in| module |
|000036b0| 69 66 20 74 68 65 20 67 | 69 76 65 6e 20 6e 61 6d |if the g|iven nam|
|000036c0| 65 20 69 73 20 66 6f 75 | 6e 64 2c 20 69 74 0d 73 |e is fou|nd, it.s|
|000036d0| 65 61 72 63 68 65 73 20 | 61 20 75 73 65 72 2d 73 |earches |a user-s|
|000036e0| 70 65 63 69 66 69 65 64 | 20 6c 69 73 74 20 6f 66 |pecified| list of|
|000036f0| 20 64 69 72 65 63 74 6f | 72 69 65 73 20 66 6f 72 | directo|ries for|
|00003700| 20 61 20 66 69 6c 65 20 | 77 68 6f 73 65 20 6e 61 | a file |whose na|
|00003710| 6d 65 20 69 73 0d 74 68 | 65 20 6d 6f 64 75 6c 65 |me is.th|e module|
|00003720| 20 6e 61 6d 65 20 77 69 | 74 68 20 65 78 74 65 6e | name wi|th exten|
|00003730| 73 69 6f 6e 20 5c 76 65 | 72 62 40 22 2e 70 79 22 |sion \ve|rb@".py"|
|00003740| 40 2e 20 20 28 54 68 65 | 20 63 75 72 72 65 6e 74 |@. (The| current|
|00003750| 0d 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 |.impleme|ntation |
|00003760| 75 73 65 73 20 74 68 65 | 20 6c 69 73 74 20 6f 66 |uses the| list of|
|00003770| 20 73 74 72 69 6e 67 73 | 20 5c 76 65 72 62 40 73 | strings| \verb@s|
|00003780| 79 73 2e 70 61 74 68 40 | 20 61 73 20 74 68 65 20 |ys.path@| as the |
|00003790| 73 65 61 72 63 68 0d 70 | 61 74 68 3b 20 69 74 20 |search.p|ath; it |
|000037a0| 69 73 20 69 6e 69 74 69 | 61 6c 69 7a 65 64 20 66 |is initi|alized f|
|000037b0| 72 6f 6d 20 74 68 65 20 | 73 68 65 6c 6c 20 65 6e |rom the |shell en|
|000037c0| 76 69 72 6f 6e 6d 65 6e | 74 20 76 61 72 69 61 62 |vironmen|t variab|
|000037d0| 6c 65 0d 5c 76 65 72 62 | 40 24 50 59 54 48 4f 4e |le.\verb|@$PYTHON|
|000037e0| 50 41 54 48 40 2c 20 77 | 69 74 68 20 61 6e 20 69 |PATH@, w|ith an i|
|000037f0| 6e 73 74 61 6c 6c 61 74 | 69 6f 6e 2d 64 65 70 65 |nstallat|ion-depe|
|00003800| 6e 64 65 6e 74 20 64 65 | 66 61 75 6c 74 2e 29 0d |ndent de|fault.).|
|00003810| 5c 74 74 69 6e 64 65 78 | 7b 6d 6f 64 75 6c 65 73 |\ttindex|{modules|
|00003820| 7d 0d 5c 74 74 69 6e 64 | 65 78 7b 73 79 73 2e 6d |}.\ttind|ex{sys.m|
|00003830| 6f 64 75 6c 65 73 7d 0d | 5c 69 6e 64 65 78 69 69 |odules}.|\indexii|
|00003840| 7b 6d 6f 64 75 6c 65 7d | 7b 6e 61 6d 65 7d 0d 5c |{module}|{name}.\|
|00003850| 69 6e 64 65 78 69 69 7b | 62 75 69 6c 74 2d 69 6e |indexii{|built-in|
|00003860| 7d 7b 6d 6f 64 75 6c 65 | 7d 0d 5c 69 6e 64 65 78 |}{module|}.\index|
|00003870| 69 69 7b 75 73 65 72 2d | 64 65 66 69 6e 65 64 7d |ii{user-|defined}|
|00003880| 7b 6d 6f 64 75 6c 65 7d | 0d 5c 62 69 6d 6f 64 69 |{module}|.\bimodi|
|00003890| 6e 64 65 78 7b 73 79 73 | 7d 0d 5c 74 74 69 6e 64 |ndex{sys|}.\ttind|
|000038a0| 65 78 7b 70 61 74 68 7d | 0d 5c 74 74 69 6e 64 65 |ex{path}|.\ttinde|
|000038b0| 78 7b 73 79 73 2e 70 61 | 74 68 7d 0d 5c 69 6e 64 |x{sys.pa|th}.\ind|
|000038c0| 65 78 69 69 7b 66 69 6c | 65 6e 61 6d 65 7d 7b 65 |exii{fil|ename}{e|
|000038d0| 78 74 65 6e 73 69 6f 6e | 7d 0d 0d 49 66 20 61 20 |xtension|}..If a |
|000038e0| 62 75 69 6c 74 2d 69 6e | 20 6d 6f 64 75 6c 65 20 |built-in| module |
|000038f0| 69 73 20 66 6f 75 6e 64 | 2c 20 69 74 73 20 62 75 |is found|, its bu|
|00003900| 69 6c 74 2d 69 6e 20 69 | 6e 69 74 69 61 6c 69 7a |ilt-in i|nitializ|
|00003910| 61 74 69 6f 6e 20 63 6f | 64 65 20 69 73 0d 65 78 |ation co|de is.ex|
|00003920| 65 63 75 74 65 64 20 61 | 6e 64 20 73 74 65 70 20 |ecuted a|nd step |
|00003930| 28 31 29 20 69 73 20 66 | 69 6e 69 73 68 65 64 2e |(1) is f|inished.|
|00003940| 20 20 49 66 20 6e 6f 20 | 6d 61 74 63 68 69 6e 67 | If no |matching|
|00003950| 20 66 69 6c 65 20 69 73 | 20 66 6f 75 6e 64 2c 0d | file is| found,.|
|00003960| 5c 76 65 72 62 40 49 6d | 70 6f 72 74 45 72 72 6f |\verb@Im|portErro|
|00003970| 72 40 20 69 73 20 72 61 | 69 73 65 64 2e 20 20 49 |r@ is ra|ised. I|
|00003980| 66 20 61 20 66 69 6c 65 | 20 69 73 20 66 6f 75 6e |f a file| is foun|
|00003990| 64 2c 20 69 74 20 69 73 | 20 70 61 72 73 65 64 2c |d, it is| parsed,|
|000039a0| 0d 79 69 65 6c 64 69 6e | 67 20 61 6e 20 65 78 65 |.yieldin|g an exe|
|000039b0| 63 75 74 61 62 6c 65 20 | 63 6f 64 65 20 62 6c 6f |cutable |code blo|
|000039c0| 63 6b 2e 20 20 49 66 20 | 61 20 73 79 6e 74 61 78 |ck. If |a syntax|
|000039d0| 20 65 72 72 6f 72 20 6f | 63 63 75 72 73 2c 0d 5c | error o|ccurs,.\|
|000039e0| 76 65 72 62 40 53 79 6e | 74 61 78 45 72 72 6f 72 |verb@Syn|taxError|
|000039f0| 40 20 69 73 20 72 61 69 | 73 65 64 2e 20 20 4f 74 |@ is rai|sed. Ot|
|00003a00| 68 65 72 77 69 73 65 2c | 20 61 6e 20 65 6d 70 74 |herwise,| an empt|
|00003a10| 79 20 6d 6f 64 75 6c 65 | 20 6f 66 20 74 68 65 20 |y module| of the |
|00003a20| 67 69 76 65 6e 0d 6e 61 | 6d 65 20 69 73 20 63 72 |given.na|me is cr|
|00003a30| 65 61 74 65 64 20 61 6e | 64 20 69 6e 73 65 72 74 |eated an|d insert|
|00003a40| 65 64 20 69 6e 20 74 68 | 65 20 6d 6f 64 75 6c 65 |ed in th|e module|
|00003a50| 20 74 61 62 6c 65 2c 20 | 61 6e 64 20 74 68 65 6e | table, |and then|
|00003a60| 20 74 68 65 20 63 6f 64 | 65 0d 62 6c 6f 63 6b 20 | the cod|e.block |
|00003a70| 69 73 20 65 78 65 63 75 | 74 65 64 20 69 6e 20 74 |is execu|ted in t|
|00003a80| 68 65 20 63 6f 6e 74 65 | 78 74 20 6f 66 20 74 68 |he conte|xt of th|
|00003a90| 69 73 20 6d 6f 64 75 6c | 65 2e 20 20 45 78 63 65 |is modul|e. Exce|
|00003aa0| 70 74 69 6f 6e 73 20 64 | 75 72 69 6e 67 0d 74 68 |ptions d|uring.th|
|00003ab0| 69 73 20 65 78 65 63 75 | 74 69 6f 6e 20 74 65 72 |is execu|tion ter|
|00003ac0| 6d 69 6e 61 74 65 20 73 | 74 65 70 20 28 31 29 2e |minate s|tep (1).|
|00003ad0| 0d 5c 69 6e 64 65 78 69 | 69 7b 6d 6f 64 75 6c 65 |.\indexi|i{module|
|00003ae0| 7d 7b 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |}{initia|lization|
|00003af0| 7d 0d 5c 65 78 69 6e 64 | 65 78 7b 53 79 6e 74 61 |}.\exind|ex{Synta|
|00003b00| 78 45 72 72 6f 72 7d 0d | 5c 65 78 69 6e 64 65 78 |xError}.|\exindex|
|00003b10| 7b 49 6d 70 6f 72 74 45 | 72 72 6f 72 7d 0d 5c 69 |{ImportE|rror}.\i|
|00003b20| 6e 64 65 78 7b 63 6f 64 | 65 20 62 6c 6f 63 6b 7d |ndex{cod|e block}|
|00003b30| 0d 0d 57 68 65 6e 20 73 | 74 65 70 20 28 31 29 20 |..When s|tep (1) |
|00003b40| 66 69 6e 69 73 68 65 73 | 20 77 69 74 68 6f 75 74 |finishes| without|
|00003b50| 20 72 61 69 73 69 6e 67 | 20 61 6e 20 65 78 63 65 | raising| an exce|
|00003b60| 70 74 69 6f 6e 2c 20 73 | 74 65 70 20 28 32 29 20 |ption, s|tep (2) |
|00003b70| 63 61 6e 0d 62 65 67 69 | 6e 2e 0d 0d 54 68 65 20 |can.begi|n...The |
|00003b80| 66 69 72 73 74 20 66 6f | 72 6d 20 6f 66 20 5c 76 |first fo|rm of \v|
|00003b90| 65 72 62 40 69 6d 70 6f | 72 74 40 20 73 74 61 74 |erb@impo|rt@ stat|
|00003ba0| 65 6d 65 6e 74 20 62 69 | 6e 64 73 20 74 68 65 20 |ement bi|nds the |
|00003bb0| 6d 6f 64 75 6c 65 20 6e | 61 6d 65 20 69 6e 20 74 |module n|ame in t|
|00003bc0| 68 65 0d 6c 6f 63 61 6c | 20 6e 61 6d 65 20 73 70 |he.local| name sp|
|00003bd0| 61 63 65 20 74 6f 20 74 | 68 65 20 6d 6f 64 75 6c |ace to t|he modul|
|00003be0| 65 20 6f 62 6a 65 63 74 | 2c 20 61 6e 64 20 74 68 |e object|, and th|
|00003bf0| 65 6e 20 67 6f 65 73 20 | 6f 6e 20 74 6f 20 69 6d |en goes |on to im|
|00003c00| 70 6f 72 74 20 74 68 65 | 0d 6e 65 78 74 20 69 64 |port the|.next id|
|00003c10| 65 6e 74 69 66 69 65 72 | 2c 20 69 66 20 61 6e 79 |entifier|, if any|
|00003c20| 2e 20 20 54 68 65 20 5c | 76 65 72 62 40 66 72 6f |. The \|verb@fro|
|00003c30| 6d 40 20 66 72 6f 6d 20 | 64 6f 65 73 20 6e 6f 74 |m@ from |does not|
|00003c40| 20 62 69 6e 64 20 74 68 | 65 0d 6d 6f 64 75 6c 65 | bind th|e.module|
|00003c50| 20 6e 61 6d 65 3a 20 69 | 74 20 67 6f 65 73 20 74 | name: i|t goes t|
|00003c60| 68 72 6f 75 67 68 20 74 | 68 65 20 6c 69 73 74 20 |hrough t|he list |
|00003c70| 6f 66 20 69 64 65 6e 74 | 69 66 69 65 72 73 2c 20 |of ident|ifiers, |
|00003c80| 6c 6f 6f 6b 73 20 65 61 | 63 68 20 6f 6e 65 0d 6f |looks ea|ch one.o|
|00003c90| 66 20 74 68 65 6d 20 75 | 70 20 69 6e 20 74 68 65 |f them u|p in the|
|00003ca0| 20 6d 6f 64 75 6c 65 20 | 66 6f 75 6e 64 20 69 6e | module |found in|
|00003cb0| 20 73 74 65 70 20 28 31 | 29 2c 20 61 6e 64 20 62 | step (1|), and b|
|00003cc0| 69 6e 64 73 20 74 68 65 | 20 6e 61 6d 65 20 69 6e |inds the| name in|
|00003cd0| 20 74 68 65 0d 6c 6f 63 | 61 6c 20 6e 61 6d 65 20 | the.loc|al name |
|00003ce0| 73 70 61 63 65 20 74 6f | 20 74 68 65 20 6f 62 6a |space to| the obj|
|00003cf0| 65 63 74 20 74 68 75 73 | 20 66 6f 75 6e 64 2e 20 |ect thus| found. |
|00003d00| 20 49 66 20 61 20 6e 61 | 6d 65 20 69 73 20 6e 6f | If a na|me is no|
|00003d10| 74 20 66 6f 75 6e 64 2c | 0d 5c 76 65 72 62 40 49 |t found,|.\verb@I|
|00003d20| 6d 70 6f 72 74 45 72 72 | 6f 72 40 20 69 73 20 72 |mportErr|or@ is r|
|00003d30| 61 69 73 65 64 2e 20 20 | 49 66 20 74 68 65 20 6c |aised. |If the l|
|00003d40| 69 73 74 20 6f 66 20 69 | 64 65 6e 74 69 66 69 65 |ist of i|dentifie|
|00003d50| 72 73 20 69 73 20 72 65 | 70 6c 61 63 65 64 0d 62 |rs is re|placed.b|
|00003d60| 79 20 61 20 73 74 61 72 | 20 28 5c 76 65 72 62 40 |y a star| (\verb@|
|00003d70| 2a 40 29 2c 20 61 6c 6c | 20 6e 61 6d 65 73 20 64 |*@), all| names d|
|00003d80| 65 66 69 6e 65 64 20 69 | 6e 20 74 68 65 20 6d 6f |efined i|n the mo|
|00003d90| 64 75 6c 65 20 61 72 65 | 20 62 6f 75 6e 64 2c 0d |dule are| bound,.|
|00003da0| 65 78 63 65 70 74 20 74 | 68 6f 73 65 20 62 65 67 |except t|hose beg|
|00003db0| 69 6e 6e 69 6e 67 20 77 | 69 74 68 20 61 6e 20 75 |inning w|ith an u|
|00003dc0| 6e 64 65 72 73 63 6f 72 | 65 28 5c 76 65 72 62 40 |nderscor|e(\verb@|
|00003dd0| 5f 40 29 2e 0d 5c 69 6e | 64 65 78 69 69 7b 6e 61 |_@)..\in|dexii{na|
|00003de0| 6d 65 7d 7b 62 69 6e 64 | 69 6e 67 7d 0d 5c 65 78 |me}{bind|ing}.\ex|
|00003df0| 69 6e 64 65 78 7b 49 6d | 70 6f 72 74 45 72 72 6f |index{Im|portErro|
|00003e00| 72 7d 0d 0d 4e 61 6d 65 | 73 20 62 6f 75 6e 64 20 |r}..Name|s bound |
|00003e10| 62 79 20 69 6d 70 6f 72 | 74 20 73 74 61 74 65 6d |by impor|t statem|
|00003e20| 65 6e 74 73 20 6d 61 79 | 20 6e 6f 74 20 6f 63 63 |ents may| not occ|
|00003e30| 75 72 20 69 6e 20 5c 76 | 65 72 62 40 67 6c 6f 62 |ur in \v|erb@glob|
|00003e40| 61 6c 40 0d 73 74 61 74 | 65 6d 65 6e 74 73 20 69 |al@.stat|ements i|
|00003e50| 6e 20 74 68 65 20 73 61 | 6d 65 20 73 63 6f 70 65 |n the sa|me scope|
|00003e60| 2e 0d 5c 73 74 69 6e 64 | 65 78 7b 67 6c 6f 62 61 |..\stind|ex{globa|
|00003e70| 6c 7d 0d 0d 54 68 65 20 | 5c 76 65 72 62 40 66 72 |l}..The |\verb@fr|
|00003e80| 6f 6d 40 20 66 6f 72 6d | 20 77 69 74 68 20 5c 76 |om@ form| with \v|
|00003e90| 65 72 62 40 2a 40 20 6d | 61 79 20 6f 6e 6c 79 20 |erb@*@ m|ay only |
|00003ea0| 6f 63 63 75 72 20 69 6e | 20 61 20 6d 6f 64 75 6c |occur in| a modul|
|00003eb0| 65 20 73 63 6f 70 65 2e | 0d 5c 6b 77 69 6e 64 65 |e scope.|.\kwinde|
|00003ec0| 78 7b 66 72 6f 6d 7d 0d | 5c 74 74 69 6e 64 65 78 |x{from}.|\ttindex|
|00003ed0| 7b 66 72 6f 6d 20 2e 2e | 2e 20 69 6d 70 6f 72 74 |{from ..|. import|
|00003ee0| 20 2a 7d 0d 0d 28 54 68 | 65 20 63 75 72 72 65 6e | *}..(Th|e curren|
|00003ef0| 74 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |t implem|entation|
|00003f00| 20 64 6f 65 73 20 6e 6f | 74 20 65 6e 66 6f 72 63 | does no|t enforc|
|00003f10| 65 20 74 68 65 20 6c 61 | 74 74 65 72 20 74 77 6f |e the la|tter two|
|00003f20| 0d 72 65 73 74 72 69 63 | 74 69 6f 6e 73 2c 20 62 |.restric|tions, b|
|00003f30| 75 74 20 70 72 6f 67 72 | 61 6d 73 20 73 68 6f 75 |ut progr|ams shou|
|00003f40| 6c 64 20 6e 6f 74 20 61 | 62 75 73 65 20 74 68 69 |ld not a|buse thi|
|00003f50| 73 20 66 72 65 65 64 6f | 6d 2c 20 61 73 20 66 75 |s freedo|m, as fu|
|00003f60| 74 75 72 65 0d 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |ture.imp|lementat|
|00003f70| 69 6f 6e 73 20 6d 61 79 | 20 65 6e 66 6f 72 63 65 |ions may| enforce|
|00003f80| 20 74 68 65 6d 20 6f 72 | 20 73 69 6c 65 6e 74 6c | them or| silentl|
|00003f90| 79 20 63 68 61 6e 67 65 | 20 74 68 65 20 6d 65 61 |y change| the mea|
|00003fa0| 6e 69 6e 67 20 6f 66 20 | 74 68 65 0d 70 72 6f 67 |ning of |the.prog|
|00003fb0| 72 61 6d 2e 29 0d 0d 5c | 73 65 63 74 69 6f 6e 7b |ram.)..\|section{|
|00003fc0| 54 68 65 20 7b 5c 74 74 | 20 67 6c 6f 62 61 6c 7d |The {\tt| global}|
|00003fd0| 20 73 74 61 74 65 6d 65 | 6e 74 7d 20 5c 6c 61 62 | stateme|nt} \lab|
|00003fe0| 65 6c 7b 67 6c 6f 62 61 | 6c 7d 0d 5c 73 74 69 6e |el{globa|l}.\stin|
|00003ff0| 64 65 78 7b 67 6c 6f 62 | 61 6c 7d 0d 0d 5c 62 65 |dex{glob|al}..\be|
|00004000| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0d 67 6c |gin{verb|atim}.gl|
|00004010| 6f 62 61 6c 5f 73 74 6d | 74 3a 20 20 20 20 22 67 |obal_stm|t: "g|
|00004020| 6c 6f 62 61 6c 22 20 69 | 64 65 6e 74 69 66 69 65 |lobal" i|dentifie|
|00004030| 72 20 28 22 2c 22 20 69 | 64 65 6e 74 69 66 69 65 |r ("," i|dentifie|
|00004040| 72 29 2a 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |r)*.\end|{verbati|
|00004050| 6d 7d 0d 0d 54 68 65 20 | 5c 76 65 72 62 40 67 6c |m}..The |\verb@gl|
|00004060| 6f 62 61 6c 40 20 73 74 | 61 74 65 6d 65 6e 74 20 |obal@ st|atement |
|00004070| 69 73 20 61 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |is a dec|laration|
|00004080| 20 77 68 69 63 68 20 68 | 6f 6c 64 73 20 66 6f 72 | which h|olds for|
|00004090| 20 74 68 65 0d 65 6e 74 | 69 72 65 20 63 75 72 72 | the.ent|ire curr|
|000040a0| 65 6e 74 20 73 63 6f 70 | 65 2e 20 20 49 74 20 6d |ent scop|e. It m|
|000040b0| 65 61 6e 73 20 74 68 61 | 74 20 74 68 65 20 6c 69 |eans tha|t the li|
|000040c0| 73 74 65 64 20 69 64 65 | 6e 74 69 66 69 65 72 73 |sted ide|ntifiers|
|000040d0| 20 61 72 65 20 74 6f 20 | 62 65 0d 69 6e 74 65 72 | are to |be.inter|
|000040e0| 70 72 65 74 65 64 20 61 | 73 20 67 6c 6f 62 61 6c |preted a|s global|
|000040f0| 73 2e 20 20 57 68 69 6c | 65 20 7b 5c 65 6d 20 75 |s. Whil|e {\em u|
|00004100| 73 69 6e 67 7d 20 67 6c | 6f 62 61 6c 20 6e 61 6d |sing} gl|obal nam|
|00004110| 65 73 20 69 73 20 61 75 | 74 6f 6d 61 74 69 63 0d |es is au|tomatic.|
|00004120| 69 66 20 74 68 65 79 20 | 61 72 65 20 6e 6f 74 20 |if they |are not |
|00004130| 64 65 66 69 6e 65 64 20 | 69 6e 20 74 68 65 20 6c |defined |in the l|
|00004140| 6f 63 61 6c 20 73 63 6f | 70 65 2c 20 7b 5c 65 6d |ocal sco|pe, {\em|
|00004150| 20 61 73 73 69 67 6e 69 | 6e 67 7d 20 74 6f 20 67 | assigni|ng} to g|
|00004160| 6c 6f 62 61 6c 0d 6e 61 | 6d 65 73 20 77 6f 75 6c |lobal.na|mes woul|
|00004170| 64 20 62 65 20 69 6d 70 | 6f 73 73 69 62 6c 65 20 |d be imp|ossible |
|00004180| 77 69 74 68 6f 75 74 20 | 5c 76 65 72 62 40 67 6c |without |\verb@gl|
|00004190| 6f 62 61 6c 40 2e 0d 5c | 69 6e 64 65 78 69 69 69 |obal@..\|indexiii|
|000041a0| 7b 67 6c 6f 62 61 6c 7d | 7b 6e 61 6d 65 7d 7b 62 |{global}|{name}{b|
|000041b0| 69 6e 64 69 6e 67 7d 0d | 0d 4e 61 6d 65 73 20 6c |inding}.|.Names l|
|000041c0| 69 73 74 65 64 20 69 6e | 20 61 20 5c 76 65 72 62 |isted in| a \verb|
|000041d0| 40 67 6c 6f 62 61 6c 40 | 20 73 74 61 74 65 6d 65 |@global@| stateme|
|000041e0| 6e 74 20 6d 75 73 74 20 | 6e 6f 74 20 62 65 20 75 |nt must |not be u|
|000041f0| 73 65 64 20 69 6e 20 74 | 68 65 20 73 61 6d 65 0d |sed in t|he same.|
|00004200| 73 63 6f 70 65 20 62 65 | 66 6f 72 65 20 74 68 61 |scope be|fore tha|
|00004210| 74 20 5c 76 65 72 62 40 | 67 6c 6f 62 61 6c 40 20 |t \verb@|global@ |
|00004220| 73 74 61 74 65 6d 65 6e | 74 20 69 73 20 65 78 65 |statemen|t is exe|
|00004230| 63 75 74 65 64 2e 0d 0d | 4e 61 6d 65 73 20 6c 69 |cuted...|Names li|
|00004240| 73 74 65 64 20 69 6e 20 | 61 20 5c 76 65 72 62 40 |sted in |a \verb@|
|00004250| 67 6c 6f 62 61 6c 40 20 | 73 74 61 74 65 6d 65 6e |global@ |statemen|
|00004260| 74 20 6d 75 73 74 20 6e | 6f 74 20 62 65 20 64 65 |t must n|ot be de|
|00004270| 66 69 6e 65 64 20 61 73 | 20 66 6f 72 6d 61 6c 0d |fined as| formal.|
|00004280| 70 61 72 61 6d 65 74 65 | 72 73 20 6f 72 20 69 6e |paramete|rs or in|
|00004290| 20 61 20 5c 76 65 72 62 | 40 66 6f 72 40 20 6c 6f | a \verb|@for@ lo|
|000042a0| 6f 70 20 63 6f 6e 74 72 | 6f 6c 20 74 61 72 67 65 |op contr|ol targe|
|000042b0| 74 2c 20 5c 76 65 72 62 | 40 63 6c 61 73 73 40 0d |t, \verb|@class@.|
|000042c0| 64 65 66 69 6e 69 74 69 | 6f 6e 2c 20 66 75 6e 63 |definiti|on, func|
|000042d0| 74 69 6f 6e 20 64 65 66 | 69 6e 69 74 69 6f 6e 2c |tion def|inition,|
|000042e0| 20 6f 72 20 5c 76 65 72 | 62 40 69 6d 70 6f 72 74 | or \ver|b@import|
|000042f0| 40 20 73 74 61 74 65 6d | 65 6e 74 2e 0d 0d 28 54 |@ statem|ent...(T|
|00004300| 68 65 20 63 75 72 72 65 | 6e 74 20 69 6d 70 6c 65 |he curre|nt imple|
|00004310| 6d 65 6e 74 61 74 69 6f | 6e 20 64 6f 65 73 20 6e |mentatio|n does n|
|00004320| 6f 74 20 65 6e 66 6f 72 | 63 65 20 74 68 65 20 6c |ot enfor|ce the l|
|00004330| 61 74 74 65 72 20 74 77 | 6f 0d 72 65 73 74 72 69 |atter tw|o.restri|
|00004340| 63 74 69 6f 6e 73 2c 20 | 62 75 74 20 70 72 6f 67 |ctions, |but prog|
|00004350| 72 61 6d 73 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 |rams sho|uld not |
|00004360| 61 62 75 73 65 20 74 68 | 69 73 20 66 72 65 65 64 |abuse th|is freed|
|00004370| 6f 6d 2c 20 61 73 20 66 | 75 74 75 72 65 0d 69 6d |om, as f|uture.im|
|00004380| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 73 20 6d 61 |plementa|tions ma|
|00004390| 79 20 65 6e 66 6f 72 63 | 65 20 74 68 65 6d 20 6f |y enforc|e them o|
|000043a0| 72 20 73 69 6c 65 6e 74 | 6c 79 20 63 68 61 6e 67 |r silent|ly chang|
|000043b0| 65 20 74 68 65 20 6d 65 | 61 6e 69 6e 67 20 6f 66 |e the me|aning of|
|000043c0| 20 74 68 65 0d 70 72 6f | 67 72 61 6d 2e 29 0d 0d | the.pro|gram.)..|
|000043d0| 5c 73 65 63 74 69 6f 6e | 7b 54 68 65 20 7b 5c 74 |\section|{The {\t|
|000043e0| 74 20 61 63 63 65 73 73 | 7d 20 73 74 61 74 65 6d |t access|} statem|
|000043f0| 65 6e 74 7d 20 5c 6c 61 | 62 65 6c 7b 61 63 63 65 |ent} \la|bel{acce|
|00004400| 73 73 7d 0d 5c 73 74 69 | 6e 64 65 78 7b 61 63 63 |ss}.\sti|ndex{acc|
|00004410| 65 73 73 7d 0d 0d 5c 62 | 65 67 69 6e 7b 76 65 72 |ess}..\b|egin{ver|
|00004420| 62 61 74 69 6d 7d 0d 61 | 63 63 65 73 73 5f 73 74 |batim}.a|ccess_st|
|00004430| 6d 74 3a 20 20 20 20 22 | 61 63 63 65 73 73 22 20 |mt: "|access" |
|00004440| 2e 2e 2e 0d 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |....\end|{verbati|
|00004450| 6d 7d 0d 0d 54 68 69 73 | 20 73 74 61 74 65 6d 65 |m}..This| stateme|
|00004460| 6e 74 20 77 69 6c 6c 20 | 62 65 20 75 73 65 64 20 |nt will |be used |
|00004470| 69 6e 20 74 68 65 20 66 | 75 74 75 72 65 20 74 6f |in the f|uture to|
|00004480| 20 63 6f 6e 74 72 6f 6c | 20 61 63 63 65 73 73 20 | control| access |
|00004490| 74 6f 0d 69 6e 73 74 61 | 6e 63 65 20 61 6e 64 20 |to.insta|nce and |
|000044a0| 63 6c 61 73 73 20 76 61 | 72 69 61 62 6c 65 73 2e |class va|riables.|
|000044b0| 20 20 43 75 72 72 65 6e | 74 6c 79 20 69 74 73 20 | Curren|tly its |
|000044c0| 73 79 6e 74 61 78 20 61 | 6e 64 20 65 66 66 65 63 |syntax a|nd effec|
|000044d0| 74 73 20 61 72 65 0d 75 | 6e 64 65 66 69 6e 65 64 |ts are.u|ndefined|
|000044e0| 3b 20 68 6f 77 65 76 65 | 72 20 74 68 65 20 6b 65 |; howeve|r the ke|
|000044f0| 79 77 6f 72 64 20 5c 76 | 65 72 62 40 61 63 63 65 |yword \v|erb@acce|
|00004500| 73 73 40 20 69 73 20 61 | 20 72 65 73 65 72 76 65 |ss@ is a| reserve|
|00004510| 64 20 77 6f 72 64 20 66 | 6f 72 0d 74 68 65 20 70 |d word f|or.the p|
|00004520| 61 72 73 65 72 2e 0d 0d | 5c 73 65 63 74 69 6f 6e |arser...|\section|
|00004530| 7b 54 68 65 20 7b 5c 74 | 74 20 65 78 65 63 7d 20 |{The {\t|t exec} |
|00004540| 73 74 61 74 65 6d 65 6e | 74 7d 20 5c 6c 61 62 65 |statemen|t} \labe|
|00004550| 6c 7b 65 78 65 63 7d 0d | 5c 73 74 69 6e 64 65 78 |l{exec}.|\stindex|
|00004560| 7b 65 78 65 63 7d 0d 0d | 5c 62 65 67 69 6e 7b 76 |{exec}..|\begin{v|
|00004570| 65 72 62 61 74 69 6d 7d | 0d 65 78 65 63 5f 73 74 |erbatim}|.exec_st|
|00004580| 6d 74 3a 20 20 20 20 22 | 65 78 65 63 22 20 65 78 |mt: "|exec" ex|
|00004590| 70 72 65 73 73 69 6f 6e | 20 5b 22 69 6e 22 20 65 |pression| ["in" e|
|000045a0| 78 70 72 65 73 73 69 6f | 6e 20 5b 22 2c 22 20 65 |xpressio|n ["," e|
|000045b0| 78 70 72 65 73 73 69 6f | 6e 5d 5d 0d 5c 65 6e 64 |xpressio|n]].\end|
|000045c0| 7b 76 65 72 62 61 74 69 | 6d 7d 0d 0d 54 68 69 73 |{verbati|m}..This|
|000045d0| 20 73 74 61 74 65 6d 65 | 6e 74 20 73 75 70 70 6f | stateme|nt suppo|
|000045e0| 72 74 73 20 64 79 6e 61 | 6d 69 63 20 65 78 65 63 |rts dyna|mic exec|
|000045f0| 75 74 69 6f 6e 20 6f 66 | 20 50 79 74 68 6f 6e 20 |ution of| Python |
|00004600| 63 6f 64 65 2e 20 20 54 | 68 65 20 66 69 72 73 74 |code. T|he first|
|00004610| 0d 65 78 70 72 65 73 73 | 69 6f 6e 20 73 68 6f 75 |.express|ion shou|
|00004620| 6c 64 20 65 76 61 6c 75 | 61 74 65 20 74 6f 20 65 |ld evalu|ate to e|
|00004630| 69 74 68 65 72 20 61 20 | 73 74 72 69 6e 67 2c 20 |ither a |string, |
|00004640| 61 6e 20 6f 70 65 6e 20 | 66 69 6c 65 20 6f 62 6a |an open |file obj|
|00004650| 65 63 74 2c 20 6f 72 0d | 61 20 63 6f 64 65 20 6f |ect, or.|a code o|
|00004660| 62 6a 65 63 74 2e 20 20 | 49 66 20 69 74 20 69 73 |bject. |If it is|
|00004670| 20 61 20 73 74 72 69 6e | 67 2c 20 74 68 65 20 73 | a strin|g, the s|
|00004680| 74 72 69 6e 67 20 69 73 | 20 70 61 72 73 65 64 20 |tring is| parsed |
|00004690| 61 73 20 61 20 73 75 69 | 74 65 20 6f 66 0d 50 79 |as a sui|te of.Py|
|000046a0| 74 68 6f 6e 20 73 74 61 | 74 65 6d 65 6e 74 73 20 |thon sta|tements |
|000046b0| 77 68 69 63 68 20 69 73 | 20 74 68 65 6e 20 65 78 |which is| then ex|
|000046c0| 65 63 75 74 65 64 20 28 | 75 6e 6c 65 73 73 20 61 |ecuted (|unless a|
|000046d0| 20 73 79 6e 74 61 78 20 | 65 72 72 6f 72 0d 6f 63 | syntax |error.oc|
|000046e0| 63 75 72 73 29 2e 20 20 | 49 66 20 69 74 20 69 73 |curs). |If it is|
|000046f0| 20 61 6e 20 6f 70 65 6e | 20 66 69 6c 65 2c 20 74 | an open| file, t|
|00004700| 68 65 20 66 69 6c 65 20 | 69 73 20 70 61 72 73 65 |he file |is parse|
|00004710| 64 20 75 6e 74 69 6c 20 | 45 4f 46 20 61 6e 64 0d |d until |EOF and.|
|00004720| 65 78 65 63 75 74 65 64 | 2e 20 20 49 66 20 69 74 |executed|. If it|
|00004730| 20 69 73 20 61 20 63 6f | 64 65 20 6f 62 6a 65 63 | is a co|de objec|
|00004740| 74 2c 20 69 74 20 69 73 | 20 73 69 6d 70 6c 79 20 |t, it is| simply |
|00004750| 65 78 65 63 75 74 65 64 | 2e 0d 0d 49 6e 20 61 6c |executed|...In al|
|00004760| 6c 20 63 61 73 65 73 2c | 20 69 66 20 74 68 65 20 |l cases,| if the |
|00004770| 6f 70 74 69 6f 6e 61 6c | 20 70 61 72 74 73 20 61 |optional| parts a|
|00004780| 72 65 20 6f 6d 69 74 74 | 65 64 2c 20 74 68 65 20 |re omitt|ed, the |
|00004790| 63 6f 64 65 20 69 73 20 | 65 78 65 63 75 74 65 64 |code is |executed|
|000047a0| 0d 69 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |.in the |current |
|000047b0| 73 63 6f 70 65 2e 20 20 | 49 66 20 6f 6e 6c 79 20 |scope. |If only |
|000047c0| 74 68 65 20 66 69 72 73 | 74 20 65 78 70 72 65 73 |the firs|t expres|
|000047d0| 73 69 6f 6e 20 61 66 74 | 65 72 20 5c 76 65 72 62 |sion aft|er \verb|
|000047e0| 40 69 6e 40 20 69 73 0d | 73 70 65 63 69 66 69 65 |@in@ is.|specifie|
|000047f0| 64 2c 20 69 74 20 73 68 | 6f 75 6c 64 20 62 65 20 |d, it sh|ould be |
|00004800| 61 20 64 69 63 74 69 6f | 6e 61 72 79 2c 20 77 68 |a dictio|nary, wh|
|00004810| 69 63 68 20 77 69 6c 6c | 20 62 65 20 75 73 65 64 |ich will| be used|
|00004820| 20 66 6f 72 20 62 6f 74 | 68 20 74 68 65 0d 67 6c | for bot|h the.gl|
|00004830| 6f 62 61 6c 20 61 6e 64 | 20 74 68 65 20 6c 6f 63 |obal and| the loc|
|00004840| 61 6c 20 76 61 72 69 61 | 62 6c 65 73 2e 20 20 49 |al varia|bles. I|
|00004850| 66 20 74 77 6f 20 65 78 | 70 72 65 73 73 69 6f 6e |f two ex|pression|
|00004860| 73 20 61 72 65 20 67 69 | 76 65 6e 2c 20 62 6f 74 |s are gi|ven, bot|
|00004870| 68 0d 6d 75 73 74 20 62 | 65 20 64 69 63 74 69 6f |h.must b|e dictio|
|00004880| 6e 61 72 69 65 73 20 61 | 6e 64 20 74 68 65 79 20 |naries a|nd they |
|00004890| 61 72 65 20 75 73 65 64 | 20 66 6f 72 20 74 68 65 |are used| for the|
|000048a0| 20 67 6c 6f 62 61 6c 20 | 61 6e 64 20 6c 6f 63 61 | global |and loca|
|000048b0| 6c 0d 76 61 72 69 61 62 | 6c 65 73 2c 20 72 65 73 |l.variab|les, res|
|000048c0| 70 65 63 74 69 76 65 6c | 79 2e 0d 0d 4e 6f 74 65 |pectivel|y...Note|
|000048d0| 3a 20 64 79 6e 61 6d 69 | 63 20 65 76 61 6c 75 61 |: dynami|c evalua|
|000048e0| 74 69 6f 6e 20 6f 66 20 | 65 78 70 72 65 73 73 69 |tion of |expressi|
|000048f0| 6f 6e 73 20 69 73 20 73 | 75 70 70 6f 72 74 65 64 |ons is s|upported|
|00004900| 20 62 79 20 74 68 65 20 | 62 75 69 6c 74 2d 69 6e | by the |built-in|
|00004910| 0d 66 75 6e 63 74 69 6f | 6e 20 5c 76 65 72 62 40 |.functio|n \verb@|
|00004920| 65 76 61 6c 40 2e 0d 0d | |eval@...| |
+--------+-------------------------+-------------------------+--------+--------+